The array a[8] is defined, where a,&a,&a[0] is the starting address of the array. But there is a difference in step size, that is, different types
A is equivalent to a+0 equivalent to &a[0], which is a pointer to the first element of the array, and the step is a pointed element that occupies an address space of sizeof (int).
&a is also a pointer to the first element of the array, but its meaning is to point to the first address of the entire array, to the type as a whole array, so its step is 8*sizeof (int)
While PTR means that the pin points to the array is the first address, so * (PTR-1) The value is 8
That is, the result of the output is 8
#include <stdio.h> #include <stdlib.h> #define MAX (A,b,c) ((a+b) >c)? 1:0int Main () {int a[8]={1,2,3,4,5,6 , 7,8}; int *ptr= (int*) (&a+1); printf ("%d%d%d%d%d\n", a,&a,&a[0],a+1,&a+1,&a[0]+1); printf ("%d%d\n", * (ptr-1), *ptr); return 0;}
The array's address +1 and pointer to array +1 differ