Arrays decay to pointer. Any of those pointers reference the same address in memory. The difference is in the type of this pointer.
&arrhave type pointer to int (
&arrhas type of pointer to five elements integer array (
Then, the address of operator (&) has (a + 1) operand but (a + 1) is an r-value expression and therefore &a+1 should cause a compiler error.
& operator is applied to
a not to
a + 1.
&a + 1 ===
(&a) + 1
In your case
&a is a pointer to 5 int elements.
&a + 1 references the next array of 5 int elements, not the next element of the array
a. Then you assign this value to
int * pointer and derefence the previous
int value. As pointer
ptr is referencing the element one past the last element of the the array
a so the previous element is the last element of the array
CLICK HERE to find out more related problems solutions.