I read this in my book (and many sources on the internet):
The array variable points to the first element in the array.
They point to the same address, i.e. printf
will show the same value but they have different types.
&msg
is char(*)[16]
, pointer to array 16 of char&msg[0]
is char *
, pointer to charA cheap way to test this is to do some pointer arithmetic. Try printing &msg + 1
.
This C FAQ might prove useful.