2011-06-01 106 views

回答

10

第一个是指针〜8点的整数的数组,而第二个是8的阵列指针,各为整数。

如果你只踢了cdecl,这是美妙的这样的事情:

pax$ cdecl 
Type `help' or `?' for help 

cdecl> explain int (*p)[8]; 
declare p as pointer to array 8 of int 

cdecl> explain int *p[8]; 
declare p as array 8 of pointer to int 

cdecl> explain char*(*fp[])(int,float*); 
declare fp as array of pointer to function (int, pointer to float) 
    returning pointer to char 

实际上,有一个clockwise/spiral rule,你可以用它来做到这一点在你的脑袋,但我没有,因为担心该我发现cdecl,出于同样的原因,我不再将大的任意32位数字从十进制转换为十六进制在我的头上 - 我如果我必须但可以用更容易---)

+0

我其实更喜欢C,因为它通常比英语更清晰(可能因为我不是母语)。 – AoeAoe 2012-03-15 21:37:37

4

第一p是一个指针,指向8 int数组。 第二个p是8个指向int的指针的数组。

+4

+1另外**数组不是指针,指针也不是数组** :) ... @Hanafuda:阅读[c-faq](http://c-faq.com/)的第6部分... *欢迎来到SO *。 – pmg 2011-06-01 14:01:04

相关问题