括号是什么?
在C括号[]中的优先级高于星号*
从维基百科良好的解释:
To declare a variable as being a
pointer to an array, we must make use
of parentheses. This is because in C
brackets ([]) have higher precedence
than the asterisk (*). So if we wish to declare a pointer to an array, we need to supply parentheses to override this:
double (*elephant)[20];
This declares that elephant is a
pointer, and the type it points at is
an array of 20 double values.
To declare a pointer to an array of
pointers, simply combine the
notations.
int *(*crocodile)[15];
和你的实际情况:
int (*data[2])[5];
data是2个元素的数组。每个元素包含一个指向5个int数组的指针。
所以你可以在代码中使用你的’data’类型:
int (*data[2])[5];
int x1[5];
data[0] = &x1;
data[1] = &x1;
data[2] = &x1;//
int y1[10];
data[0] = &y1;//