I was at an interview today, and was asked the difference between the following two declarations:
int *A[10];
and
int (*A)[10];
which I did not know. If you think I am missing some important pointer ‘pointer’, please let me know that too. Thanks.
The first declares an array of ten pointers to
int, the second a pointer to an array of tenints.The
[]binds tighter than the*, so the first could equivalently be written