int Foo(int *pArray[FIXED_SIZE]) { }
In the first case, pArray
is an array of pointers, not a pointer to an array .
You need parentheses to use a pointer to an array:
int Foo(int (*pArray)[FIXED_SIZE])
You will get this for free with typedef
(since it is already a type, *
has a different meaning). In other words, typedef
has its own parentheses.
Note: experience shows that in 99% of cases when someone uses a pointer to an array, they can and should simply use a pointer to the first element .
source share