Pointers are not arrays
A dereferenced char ** is an object of type char * .
The dereferenced char (*)[10] is an object of type char [10] .
Arrays are not pointers
See the c-faq entry for this very subject .
Suppose you have
char **pp; char (*pa)[10];
and, for the sake of argument, both point to the same place: 0x420000.
pp == 0x420000; (pp + 1) == 0x420000 + sizeof(char*); pa == 0x420000; (pa + 1) == 0x420000 + sizeof(char[10]); (pp + 1) != (pa + 1)
and therefore, the argument cannot be of type char** . In addition, char** and char (*)[10] are not compatible types, therefore argument types (decomposed array) must match the parameters (type in the function prototype)
pmg
source share