A pointer to 2d array

后端 未结 6 1758
予麋鹿
予麋鹿 2020-11-28 22:26

I have a question about a pointer to 2d array. If an array is something like

int a[2][3];

then, is this a pointer to array a?<

6条回答
  •  春和景丽
    2020-11-28 22:56

    Also note:

    int *p[5]        // p is an array of 5 pointers
    
    int (*p)[5]      // p points to an array of 5 ints
    
    int (*(p+5))[10] // p is a pointer to a structure where the structure's 5th element has 10 ints .
    

提交回复
热议问题