int *ptr = (int*)(&a + 1);
The address of the array is taken, and then 1 is added, which creates a pointer indicating sizeof a bytes at the beginning of a . This pointer is then transferred to int* and assigned to ptr . The same could be done with
int *ptr = &a[5];
in this case.
Then ptr - 1 is a pointer indicating sizeof(int) bytes before ptr , that is, to &a[4] , and *(ptr - 1) is a[4] .
Arithmetic of the pointer is performed in units of "point size". Since &a is a pointer to an array of 5 int - an int (*)[5] , adding 1 to it moves its 5*sizeof(int) bytes.
source share