As reference, I\'m using the following code:
#include #include int main (void) { char buf[100]; // ------> How do I find
(gdb) p &a if you need the address of variable a. A variable might be cached in a register though, in which case GDB would tell you address requested for identifier "a" which is in register $xxx.
(gdb) p &a
a
address requested for identifier "a" which is in register $xxx
Sidenote: do not use gets, see here.
gets