W
William Payne
Hello, I want to display the address a pointer points to in hexadecimal form
in the same way my debugger displays it.
Say I have P* ptr; where P is some type.
I tried:
std::sprintf(message, "%#0x, (unsigned int)ptr);
But that gives me: 0xFFFF for example, when I want 0x0000FFFF, i.e., I dont
want to drop any leading zeros. I know this is just a small cosmetic
problem, but I still would like to know how to accomplish this.
Thanks for any replies!
/ WP
in the same way my debugger displays it.
Say I have P* ptr; where P is some type.
I tried:
std::sprintf(message, "%#0x, (unsigned int)ptr);
But that gives me: 0xFFFF for example, when I want 0x0000FFFF, i.e., I dont
want to drop any leading zeros. I know this is just a small cosmetic
problem, but I still would like to know how to accomplish this.
Thanks for any replies!
/ WP