Today out of curiosity, i tried something very weird:
The Code :
int num = 2;
int * point = #
printf("%p\n" , &point);
The Question :
1) The first thing i do is i append the address of variable num to pointer point , after that i use printf() to print out the address stores in the pointer point.
2) Later , i just try to modify the code(Above Code) to see what behavior it will gives , that is by using the printf() to print out the address of pointer point instead of printing out the address stores in pointer point which is the address of variable num.
3) Still it will print me the address although the address is different to the address of the variable num , just wanna know does this behavior is well defined in C standard??Why does a pointer has its own address too because i thought its job is to store other variable address.
Thanks for spending time reading this.
A pointer is just another variable, and hence also needs a place to live.