int bar[10]; /* bar is array 10 of int, which means bar is a pointer to array 10 of int */
int (*bar)[10]; /* bar is a pointer to array 10 of int */
According to me they both are same, am I wrong? Please tell me.
Edit: int *bar[10] is completely different.
Thanks
Raja
They are completely different. The first one is an array. The second one is a pointer to an array.
The comment you have after the first
bardeclaration is absolutely incorrect. The firstbaris an array of 10ints. Period. It is not a pointer (i.e. your “which means” part makes no sense at all).It can be expressed this way:
Your first
barhas typeT, while you r secondbarhas typeT *. You understand the difference betweenTandT *, do you?