#include <stdio.h>
int main()
{
int *ptr;
int a=2;
ptr=&a;
printf("%p\n",ptr);
printf("%d\n",ptr);
printf("%p\n",a);
return 0;
}
The output I get is:
% ./a.out
0x7ffe12032c40
302197824
0x2
%
The value of the first two output changes (obviously because of ASLR) and the 0x2 remains constant.