int *p[4]; //a point array ,which point to int
int (*p)[4]; //p is a point which point to int array
中文的描述如下:
int *p[4]; 指針數組,每個元素可以分別定義指向的地址,如 下:
int a,b,c,d;
p[0] = &a;
p[1] = &b;
p[2] = &c;
p[3] = &d;
int (*p)[4]; //是指向數組的指針,可以是一維,也可以是多維,如下:
int a,b,c,d;
p[0] = &a; //error , array type 'int [4]' is not assignable
int narrary3[3][4];
p = &narray3; //ok
p[1][2] = 100; // changed narray[1][2] to 100
p[3][1];// 內存越級,分配的3*4的二維數組