$ cdecl
Type `help' or `?' for help
cdecl> explain int* arr1[8];
declare arr1 as array 8 of pointer to int
cdecl> explain int (*arr2)[8]
declare arr2 as pointer to array 8 of int
cdecl> explain int *(arr3[8])
declare arr3 as array 8 of pointer to int
cdecl>
反之亦然。
cdecl> declare x as pointer to function(void) returning pointer to float
float *(*x)(void )
注意,border的值永远不会改变,所以编译器可以优化它。这与你最初可能想使用的const int (*border)[3]:不同,const int (*border)[3]:声明border为一个指向3个整数数组的指针,只要变量存在,该数组的值就不会改变。但是,该指针可以在任何时候指向任何其他这样的数组。相反,我们希望参数也有这种行为(因为这个函数不会改变任何整数)。使用后声明。
int *a[4]; // Array of 4 pointers to int
int (*a)[4]; //a is a pointer to an integer array of size 4
int (*a[8])[5]; //a is an array of pointers to integer array of size 5