int a, *p ; p = a ;
is a perfectly valid declaration and statement and makes
ppoint to the integer
a. Furthermore, we can actually index the pointer
p. Continuing with the example above, the expressions
arefer to exactly the same integer and
aare both invalid references.
We'll see in the later sections other aspects of the connection between arrays and pointer. Things begin to get really complex when we look at the similarities and differences between arrays of pointers and multi-dimensional arrays (which are arrays of arrays).
In the code fragment:
p = &a ; printf( "%d\n", p ) ;which position in the array
awill be printed?