When I do
int k = 9;
printf("sizeof k: %zu \n", sizeof (&k));
I get the size as 8
. But when I do
printf("pointer to k: %p \n", &k);
I get 0x7fff57e3ba24
. I can see that this is 12 hex numbers which means (since 1 hex is 4 bits) that the pointer occupies 48 bits which is 6 bytes.
The question: Why does sizeof print 8 for pointer although its only 6 bytes?