Okay folks. Here goes:
int *p; pointer to int
int *p[10]; array[10] of pointers to int (not same as a 2D array)
int (*p)[10]; pointer to array[10] of int
int *p(); function returning pointer to int
int (*p)(); pointer to function returning int
int *(*p)(); pointer to function returning pointer to int
int (*p[])(); array[] of pointers to function returning int
int (*(*p())[5])(); function returning pointer to array[5] of pointers to function returning int
If you find yourself confused, believe me you are not the first in the world. But go through the above again keeping in mind the precedence and associativity of operators:
() [] {left to right}
* {right to left}
Finally if you can tell what the following is:
int *((*(*p[5])()))[10]
you can assume safely that you are a lot less confused.X-)
Bye.
Ankan. Please do correct me if I am wrong.
