int *daytab[13]; // 1)an array of 13 pointers to integers
int (*daytab)[13]; // 2)a pointer to an array of 13 integers
I express the two types of declaration according operator priority:
int a[10]; //every member of array a is an int, it has 10 members
since operator [] is more previleged than * ,so in the case 1), it is equal to
int *(daytab[13]);
daytab[13] is an array of which every member is of the same type, and then we discover the type is pointers to int,so it's an array of pointers.
In the latter case, (*datab) is recognised firt, so daytab is a pointer to a certain type, and then we discover the type is int[13], so it's a pointer to arrays.
阅读(166) | 评论(0) | 转发(0) |