When I tried printing out address of variable in C to my standard output in hexadecimal format, I got a 6 digit answer to my surprise. Since, I work on a 64 bit machine, I expected to have a 16 digit long address since 2^{64} = 16^{16}
but instead the address was just 6 digits long.
Code for reference:
#include<stdio.h>
int square();
int x;
int main(){
scanf("%d",&x);
printf("%d\n",square());
printf("\naddress of x is %x",&x);
return 0;
}
int square(){
return x*x;
}
The output was:
address of x is 407970