For the below code.
int a[4];
printf("%d\n",sizeof(a));
printf("%d\n",sizeof(&a));
The output is
16
8
'a' represents the whole array (Also, the address of the first element of the array since it is a 1D array), and sizeof(a) represents the size of the whole array. Hence the size is 16. Understood.
'&a' represents the address of the whole array, and but sizeof(&a) represents what?
I guess its output came as 8 because the value is an address and calculating the size of a pointer which is fixed? Hence 8. Am I right?
But I still didn't get clarity. Can anyone help to give a clear explanation?