<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>《简析指针与多维数组》的评论</title>
	<atom:link href="http://tonybai.com/2013/03/28/pointer-and-multi-dimension-array-in-c/feed/" rel="self" type="application/rss+xml" />
	<link>https://tonybai.com/2013/03/28/pointer-and-multi-dimension-array-in-c/</link>
	<description>一个程序员的心路历程</description>
	<lastBuildDate>Wed, 25 Mar 2026 09:21:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>作者：bigwhite</title>
		<link>https://tonybai.com/2013/03/28/pointer-and-multi-dimension-array-in-c/#comment-851</link>
		<dc:creator>bigwhite</dc:creator>
		<pubDate>Wed, 17 Apr 2013 10:38:38 +0000</pubDate>
		<guid isPermaLink="false">http://tonybai.com/?p=1236#comment-851</guid>
		<description>你发现的这个问题很好。*a 按%p输出的是地址，*a按%d输出的首个元素的值。也就是你说的不同上下文。“arr_name = &amp;arr_name = *arr_name = 数组起始地址” 这个上下文中，*数组名是按地址理解的。本文的目的是如何“合理地”理解多维数组，而数组名在这里面起到一个地址的作用，</description>
		<content:encoded><![CDATA[<p>你发现的这个问题很好。*a 按%p输出的是地址，*a按%d输出的首个元素的值。也就是你说的不同上下文。“arr_name = &amp;arr_name = *arr_name = 数组起始地址” 这个上下文中，*数组名是按地址理解的。本文的目的是如何“合理地”理解多维数组，而数组名在这里面起到一个地址的作用，</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：红猎人</title>
		<link>https://tonybai.com/2013/03/28/pointer-and-multi-dimension-array-in-c/#comment-850</link>
		<dc:creator>红猎人</dc:creator>
		<pubDate>Wed, 17 Apr 2013 02:55:13 +0000</pubDate>
		<guid isPermaLink="false">http://tonybai.com/?p=1236#comment-850</guid>
		<description>&quot;C语言数组的数组名(arr_name)有这样的特点：arr_name = &amp;arr_name = *arr_name = 数组起始地址。&quot; 这个结论可能有点问题哈：*arr_name != 数组起始地址。博主示例一：char a  ;printf(&quot;a = %pn&quot;, a);printf(&quot;&amp;a = %pn&quot;, &amp;a);printf(&quot;*a = %pn&quot;, *a);输出结果：a = 0xbfb146c0&amp;a = 0xbfb146c0*a = 0xbfb146c0博主示例二：char a   = {1, 2, 3, 4, 5};    printf(&quot;%d, %d, %dn&quot;, *a, *(a+1), *(a+2)); // 输出1, 2, 3在博主的两个示例中， *a 在示例一中==数组地址，在示例二中却等于数组的第一个元素的值。这不禁让我思考，难道*a在不同的上下文中会有不同的含义吗？在被当做指针时等于数组地址，在被当做值类型时等于第一个元素的值？于是做了以下实验：char a   = {1, 2, 3, 4, 5};  // modified by saiprintf(&quot;*a = %p a = %p &amp;a = %pn&quot;, *a, a, &amp;a);printf(&quot;*a = %d *(a+1) = %dn&quot;, *a, *(a+1));输出结果：*a = 0x1 a = 0xbfb146c0 &amp;a = 0xbfb146c0 *a = 1 *(a+1) = 2得到的结果与博主的结论有些矛盾。  </description>
		<content:encoded><![CDATA[<p>“C语言数组的数组名(arr_name)有这样的特点：arr_name = &amp;arr_name = *arr_name = 数组起始地址。” 这个结论可能有点问题哈：*arr_name != 数组起始地址。博主示例一：char a  ;printf(“a = %pn”, a);printf(“&amp;a = %pn”, &amp;a);printf(“*a = %pn”, *a);输出结果：a = 0xbfb146c0&amp;a = 0xbfb146c0*a = 0xbfb146c0博主示例二：char a   = {1, 2, 3, 4, 5};    printf(“%d, %d, %dn”, *a, *(a+1), *(a+2)); // 输出1, 2, 3在博主的两个示例中， *a 在示例一中==数组地址，在示例二中却等于数组的第一个元素的值。这不禁让我思考，难道*a在不同的上下文中会有不同的含义吗？在被当做指针时等于数组地址，在被当做值类型时等于第一个元素的值？于是做了以下实验：char a   = {1, 2, 3, 4, 5};  // modified by saiprintf(“*a = %p a = %p &amp;a = %pn”, *a, a, &amp;a);printf(“*a = %d *(a+1) = %dn”, *a, *(a+1));输出结果：*a = 0&#215;1 a = 0xbfb146c0 &amp;a = 0xbfb146c0 *a = 1 *(a+1) = 2得到的结果与博主的结论有些矛盾。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：bigwhite</title>
		<link>https://tonybai.com/2013/03/28/pointer-and-multi-dimension-array-in-c/#comment-839</link>
		<dc:creator>bigwhite</dc:creator>
		<pubDate>Mon, 01 Apr 2013 00:41:46 +0000</pubDate>
		<guid isPermaLink="false">http://tonybai.com/?p=1236#comment-839</guid>
		<description>粗略看了下，应该没问题。多说评论对方括号的显示有问题，看起来比较费劲。</description>
		<content:encoded><![CDATA[<p>粗略看了下，应该没问题。多说评论对方括号的显示有问题，看起来比较费劲。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：刘保华</title>
		<link>https://tonybai.com/2013/03/28/pointer-and-multi-dimension-array-in-c/#comment-838</link>
		<dc:creator>刘保华</dc:creator>
		<pubDate>Mon, 01 Apr 2013 00:17:44 +0000</pubDate>
		<guid isPermaLink="false">http://tonybai.com/?p=1236#comment-838</guid>
		<description>个人理解，是否正确？#include int main(void){   char a   = { &#039;&#039; };   printf(&quot; a     = %pn&quot;, a);           /*  a的类型为(char *)                */   printf(&quot; a + 1 = %pn&quot;, a + 1);       /*  a + 1中的1为1 * sizeof(char)     */   printf(&quot;&amp;a     = %pn&quot;, &amp;a);          /* &amp;a的类型为(char (*)  )           */   printf(&quot;&amp;a + 1 = %pn&quot;, &amp;a + 1);      /* &amp;a + 1中的1为1 * sizeof(char   ) */   printf(&quot;*a     = %pn&quot;, *a);          /* *a的类型为(char)                  */   return 0;}#include int main(void){   char a       = {      {         {1, 2, 3, 4, 5},         {6, 7, 8, 9, 10},         {11, 12, 13, 14, 15},      },            {         {21, 22, 23, 24, 25},         {26, 27, 28, 29, 30},         {31, 32, 33, 34, 35},      }   };      char (*p)     = a;                                                printf(&quot;a       = %dn&quot;, a      );   printf(&quot;a addr = %pn&quot;, a);                                      /*  a的类型为(char (*)    )                   */   printf(&quot;a + 1 = %pn&quot;, a + 1);                                   /*  a + 1中的1为sizeof(char     )             */   printf(&quot;*(a + 1) = %pn&quot;, *(a + 1));                             /*  *(a + 1)的类型为(char (*)  )               */   printf(&quot;*(a + 1) + 2 = %pn&quot;, *(a + 1) + 2);                     /*  *(a + 1) + 2中的2为2 * sizeof(char   )     */   printf(&quot;*(*(a + 1) + 2) = %pn&quot;, *(*(a + 1) + 2));               /*  *(*(a + 1) + 2)的类型为(char *)             */   printf(&quot;*(*(a + 1) + 2) + 3 = %pn&quot;, *(*(a + 1) + 2) + 3);       /*  *(*(a + 1) + 2) + 3)中的3为3 * sizeof(char) */   printf(&quot;*(*(*(a + 1) + 2) + 3) = %dn&quot;, *(*(*(a + 1) + 2) + 3)); /*  *(*(*(a + 1) + 2) + 3)的类型为(char)        */   return 0;}</description>
		<content:encoded><![CDATA[<p>个人理解，是否正确？#include int main(void){   char a   = { ” };   printf(” a     = %pn”, a);           /*  a的类型为(char *)                */   printf(” a + 1 = %pn”, a + 1);       /*  a + 1中的1为1 * sizeof(char)     */   printf(“&amp;a     = %pn”, &amp;a);          /* &amp;a的类型为(char (*)  )           */   printf(“&amp;a + 1 = %pn”, &amp;a + 1);      /* &amp;a + 1中的1为1 * sizeof(char   ) */   printf(“*a     = %pn”, *a);          /* *a的类型为(char)                  */   return 0;}#include int main(void){   char a       = {      {         {1, 2, 3, 4, 5},         {6, 7, 8, 9, 10},         {11, 12, 13, 14, 15},      },            {         {21, 22, 23, 24, 25},         {26, 27, 28, 29, 30},         {31, 32, 33, 34, 35},      }   };      char (*p)     = a;                                                printf(“a       = %dn”, a      );   printf(“a addr = %pn”, a);                                      /*  a的类型为(char (*)    )                   */   printf(“a + 1 = %pn”, a + 1);                                   /*  a + 1中的1为sizeof(char     )             */   printf(“*(a + 1) = %pn”, *(a + 1));                             /*  *(a + 1)的类型为(char (*)  )               */   printf(“*(a + 1) + 2 = %pn”, *(a + 1) + 2);                     /*  *(a + 1) + 2中的2为2 * sizeof(char   )     */   printf(“*(*(a + 1) + 2) = %pn”, *(*(a + 1) + 2));               /*  *(*(a + 1) + 2)的类型为(char *)             */   printf(“*(*(a + 1) + 2) + 3 = %pn”, *(*(a + 1) + 2) + 3);       /*  *(*(a + 1) + 2) + 3)中的3为3 * sizeof(char) */   printf(“*(*(*(a + 1) + 2) + 3) = %dn”, *(*(*(a + 1) + 2) + 3)); /*  *(*(*(a + 1) + 2) + 3)的类型为(char)        */   return 0;}</p>
]]></content:encoded>
	</item>
</channel>
</rss>
