Let's start with a couple of definitions:
"Array": A sequence of elements packed next to each other in memory.
"Pointer": An address to a location in memory.
So, when you have this:
int arr[10];
you have a variable called arr
whose type is an "array of 10 integers".
When you have this:
int* ptr;
you have a variable called ptr
whose type is a "pointer to an integer", which means that it contains an address to a location in memory at which it is expected that there will be an integer value.
When you have this:
int (*aptr)[10];
you have a variable called aptr
whose type is a "pointer to an array of 10 integers", which means that it contains an address to a location in memory at which it is expected that there will be 10 integers value next to each other in memory (i.e., an array of integers).
When you do this:
ptr = arr; // pointer to array
the type of ptr
is still a "pointer to an integer", however, after this assignment it just so happens that ptr
will be pointing to the start of the array arr
(which is implicitly converted to a pointer there). And so, we say that ptr
points to an array, but it's type is still int*
(or "pointer to an integer"). The thing is this, the int*
type only requires (by way of the type rules) that there is an …