Hi guys.
What is the difference between these:
- int *a[100];
- int (*a)[100];
Hi guys.
What is the difference between these:
The square array brackets (the '[' and ']') bind more tightly than the pointer operator, so the first declaration is equivalent to "int *(a[100])". Remember to read outwards from the identifier, so in the first declaration, a ("a") is an array ("a") of 100 ("a[100]") pointers ("*a[100]") to ints (int *a[100]").
In the second declaration, a is a pointer ("*a") to an array ("(*a)") of 100 ("(*a)[100]") ints.
Thank you very much.