<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>c语言 &#8211; 编程小札 &#8211; CodeShell.io</title>
	<atom:link href="https://codeshell.io/archives/category/c-lang/feed" rel="self" type="application/rss+xml" />
	<link>https://codeshell.io</link>
	<description></description>
	<lastBuildDate>Fri, 15 Aug 2025 19:42:23 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.2</generator>

<image>
	<url>https://codeshell.io/wp-content/uploads/2020/06/cropped-code-32x32.png</url>
	<title>c语言 &#8211; 编程小札 &#8211; CodeShell.io</title>
	<link>https://codeshell.io</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>C里面数组和引用</title>
		<link>https://codeshell.io/archives/427</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Tue, 10 Mar 2020 03:39:01 +0000</pubDate>
				<category><![CDATA[c语言]]></category>
		<guid isPermaLink="false">https://codeshell.io/?p=427</guid>

					<description><![CDATA[]]></description>
										<content:encoded><![CDATA[
<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="" style="font-size:clamp(14px, .875rem, 21px);line-height:clamp(20px, 1.25rem, 30px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="复制" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>int a&#91;5&#93;;
// 取a相当于(a+0)，也就是符号表中找到a，然后取数组地址加上0偏移地址，也就是数组第一个元素地址，返回类型是一个指向元素类型的指针
print("%p\n", a);
// 引用a，是直接在符号表中找到a，然后直接返回符号表中记录的数组地址，返回的类型是一个指向数组的指针
print("%p\n", &amp;a);</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">int</span><span style="color: #D8DEE9FF"> a</span><span style="color: #ECEFF4">&#91;</span><span style="color: #B48EAD">5</span><span style="color: #ECEFF4">&#93;</span><span style="color: #81A1C1">;</span></span>
<span class="line"><span style="color: #616E88">// 取a相当于(a+0)，也就是符号表中找到a，然后取数组地址加上0偏移地址，也就是数组第一个元素地址，返回类型是一个指向元素类型的指针</span></span>
<span class="line"><span style="color: #88C0D0">print</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">%p</span><span style="color: #EBCB8B">\n</span><span style="color: #ECEFF4">&quot;</span><span style="color: #ECEFF4">,</span><span style="color: #D8DEE9FF"> a</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span></span>
<span class="line"><span style="color: #616E88">// 引用a，是直接在符号表中找到a，然后直接返回符号表中记录的数组地址，返回的类型是一个指向数组的指针</span></span>
<span class="line"><span style="color: #88C0D0">print</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">%p</span><span style="color: #EBCB8B">\n</span><span style="color: #ECEFF4">&quot;</span><span style="color: #ECEFF4">,</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">&amp;</span><span style="color: #D8DEE9">a</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span></span></code></pre></div>



<p></p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
