📜  (*m) [5] 和 *m [5] 之间的区别 - 无论代码示例

📅  最后修改于: 2022-03-11 14:59:53.627000             🧑  作者: Mango

代码示例1
/*
int *a[5] - It means that "a" is an array of pointers i.e. each member in the array "a" is a pointer
of type integer; Each member of the array can hold the address of an integer.

int (*a)[5] - Here "a" is a pointer to the array of 5 integers, in other words "a" points to an array that holds 5 integers.
*/

int a[5] = {0, 1, 2, 3, 4};
int (*p)[5]; // pointer to array of 5 ints
int* b[5];   // array of 5 pointers to int

p = &a; // p points to a