Both agedo not match if you do not know. One of them is local to main, and the other is local to fun_1(). Therefore, if you do not give an address agein mainto fun_1(), they will not have the same address. Just set a breakpoint in the main and see the address of age.
(gdb) break main
(gdb) p &age
.....
(gdb) break fun_1
(gdb) p &age
.....
source
share