optind
Baurjan Ismagulov
ibr@ata.cs.hun.edu.tr
Wed Dec 10 14:20:00 GMT 2003
Hello,
given the following program:
#include <unistd.h>
int main()
{
printf("%p\n", &optind);
}
I do:
gcc -g a.c
./a.out
nm a.out |grep optind
I see, respectively:
0x80495ac
080495ac B optind@@GLIBC_2.0
After that I do:
gdb a.out
b main
r
p &optind
I see:
$1 = (int *) 0x4014814c,
whereas I expect it to be 080495ac. Naturally, "p optind" displays
another value, too. What is going on?
Thanks in advance,
Baurjan.
More information about the Gdb
mailing list