When you compile your code with %d being used for a pointer like &my_age, you should get a warning similar to:
printf.c:10:1: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘int *’ [-Wformat=]
This is because you are using the wrong format option, and this results in unspecified behavior. The results are architecture and implementation dependent. In other words, unpredictable. Don't do that.
On my computer for example, the %d expects a 4 byte value, while an address like &my_age is a 8 byte value. On my computer, this results in printf displaying the least significant 4 bytes of the pointer (which has a 1 in its msbit, so is interpreted as a negative 4 byte integer).
#include <stdio.h>
#include <stdlib.h>
int main(){
int my_age = 24;
printf("sizeof(my_age)=%d, sizeof(&my_age)=%d\n", sizeof(my_age), sizeof(&my_age));
printf("%d \t %p\n",my_age, &my_age);
printf("%d \t %d\n",my_age, &my_age);
}
Results in output:
sizeof(my_age)=4, sizeof(&my_age)=8
24 0x7ffdf27cb52c
24 -226708180
The least significant 4 byte hex value of the pointer is f27cb52c and is interpreted as decimal -226708180.
Since specifics are architecture dependent, your results may vary.
See post here for more details.
Bottom line: ensure that all warnings are resolved before testing your code.