text: webpackJsonp([0x947281cdbc93],{494:function(n,a){n.exports={data:{markdownRemark:{html:'<h1>C语言习题（四）</h1>\n<h2>关于二维数组的指针问题</h2>\n<p><code>a</code>表示二维数组首元素的地址，即表示了<code>a[0]</code>这个数组的首地址，按照常理，<code>a[0]</code>应该是个指针，存着<code>a[0][0]</code>的地址。然后事实上，<code>a[0]</code>这个值是通过C编译器维护的，并非真实存在的物理地址。</p>\n<p><code>a[0]</code>存储着<code>a[0][0]</code>的地址\n<code>a</code>存储着整个二维数组首元素<code>a[0][0]</code>的地址\n<code>*a</code>存储着<code>a[0]</code>的地址\na和a[0]都存着a<a href="">0</a>的地址，值是相同的。但是指针的基类型不同，a是一个二维数组\n对二维数组a来说，它的元素a[1]就是下标为1的一行数据，是个一维数组，那么如果a + 1，即是代表a[]\na的类型就是<code>int[10][10]</code>，将a作为指针运算时，它的类型会进行隐式类型转换，a[0]的类型是<code>int[10]</code>，<code>a[0][0]</code>的类型是<code>int</code>，\n如果</p>\n<p>一维数组int a[10]，a其中放着的是int类型a[0]的地址。如果a + 1，那么就是a[0]的地址加上一个int类型的大小</p>\n<div class="gatsby-highlight">\n      <pre class="language-c"><code><span class="token keyword">int</span> a<span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">4</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token punctuation">{</span> <span class="token punctuation">{</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">,</span><span class="token number">7</span><span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span><span class="token number">9</span><span class="token punctuation">,</span><span class="token number">11</span><span class="token punctuation">,</span><span class="token number">13</span><span class="token punctuation">,</span><span class="token number">15</span><span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span><span class="token number">17</span><span class="token punctuation">,</span><span class="token number">19</span><span class="token punctuation">,</span><span class="token number">21</span><span class="token punctuation">,</span><span class="token number">23</span><span class="token punctuation">}</span> <span class="token punctuation">}</span><span class="token punctuation">;</span>\n<span class="token function">printf</span><span class="token punctuation">(</span><span class="token string">"%d,%d,%d\\n"</span><span class="token punctuation">,</span> a<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span> a<span class="token punctuation">,</span> <span class="token operator">*</span>a<span class="token punctuation">)</span><span class="token punctuation">;</span>\n</code></pre>\n      </div>',frontmatter:{title:"C语言习题（四）",date:"2018-03-06",tags:["C"]}}},pathContext:{slug:"/2018-02-28----c-language-exercises-4/"}}}});
  //# sourceMappingURL=path---posts-2018-02-28-c-language-exercises-4-da6422fb80bee3093cdc.js.map