int (*ptr)[10];
I know what int *ptr[10];
its a 10 member array where each element is a pointer to an integer.
But what does the above piece code create ?
int (*ptr)[10];
I know what int *ptr[10];
its a 10 member array where each element is a pointer to an integer.
But what does the above piece code create ?
int *ptr[10]
is an array of 10 int
pointers,
int (*ptr)[10]
is a pointer to an array of 10 int
s
Cdecl (http://cdecl.ridiculousfish.com/?q=int+%28*p%29[10] ) says:
declare p as pointer to array 10 of int
That is: ptr is a pointer to an array, which is rarely useful. See http://c-faq.com/aryptr/ptrtoarray.html