D
David T
Hi,
When I use an ostream to print a address/pointer, it will
automatically extend the sign bit.
For example, suppose a pointer has a value of 0xaf46d00c. If I print
it, using
the "<<" operator, I get this:
0xffffffffaf46d00c
I would like it to print as 0xaf46d00c.
The code is generally like this:
void* myptr;
.....
clog << myptr << endl;
Any ideas on how I can use something like a global setf() flag to make
it not
extend the sign bit when printing all addresses?
Thanks,
David
When I use an ostream to print a address/pointer, it will
automatically extend the sign bit.
For example, suppose a pointer has a value of 0xaf46d00c. If I print
it, using
the "<<" operator, I get this:
0xffffffffaf46d00c
I would like it to print as 0xaf46d00c.
The code is generally like this:
void* myptr;
.....
clog << myptr << endl;
Any ideas on how I can use something like a global setf() flag to make
it not
extend the sign bit when printing all addresses?
Thanks,
David