Mail Archives: djgpp/1997/09/28/23:33:22
> int temp=5;
> cout << "Address: " << &temp
>
> Now, when I compile this and run it, I get "Address: 1" instead of the
> actual memory address of the temp variable.
>
> Does DJGPP not support the & operator? How can I see the address of a
> given variable?
try
cout << int(&temp) << endl;
or
cout << hex << int(&temp) << endl;
and it will work.. otherwise djgpp uderstand the pointer as a char* (this
is the only known pointer)...
greets, thomas...
- Raw text -