The &
operator simply returns a pointer to the whole array, so for example you can assign it to be the first part of a 1-level higher dimension array.
To understand this, we can show the difference by this code snippet:
int array[5] = {1, 2, 3, 4, 5};
printf("array address: %p\n&array address: %p\n", array, &array);
/* now test incrementing */
printf("array+1 address: %p\n&array+1 address: %p\n", array+1, &array+1);
A sample output of the above code is:
array address: 0x7fff4a53c310
&array address: 0x7fff4a53c310
array+1 address: 0x7fff4a53c314
&array+1 address: 0x7fff4a53c324
As you can see, if we increment the array
pointer, it increments address by four (As Integer takes 4-bytes in my compiler). And if we increment the &array
pointer, it increments by 20 that is 0x14.