Let's say we have
int foo[4] = {1, 2, 3, 4};
foo would then be a pointer to the first element of the array.
We can do:
printf("%p", foo); // OUTPUT is some address 0xffffcc00
Now if we do:
printf("%p", &foo); // OUTPUT is the same address 0xffffcc00
Looking online, I see this particular syntax for &<array-name> takes the address of the entire array. This explains the two same values above, because the starting element's address is the same as the whole array's address.
But in general, my understanding is that & should take address of whatever is on its right. (i.e. in this case, it "should" have taken the address of the pointer to the first element of the array.)
So why isn't &foo taking the address of the pointer foo?
If this is an exception to the C language, is this the only exception, or are there other cases like this?