Debug Qt vs memory edit
I have a question about debugging on Qt - Ubuntu 64bits. Currently, I have a code as follows:
int a = 257;
char* p = (char*)&a;
However, my issue is printf pointer's address and address of object is different.
Address of pointer - printf: prinntf("%p", p) - Result: 0x7ffef7ccd694
Address of pointer - open memory edit: 7ffef7ccd698
Who can explain this issue help me? Thanks for advanced.
Hi, the 1st address is what the pointer points to (the value of the pointer) and the 2nd address is the address to the pointer itself.
First of all there's no pointers in your example.
%pis for printing pointers and
pis not a pointer.
If you want to print the value of
p, which is the truncated address of
a, you would use
If you want to print the address of
pyou would use
I also wanna ask more a question. If I wanna watch value at address what the pointer point to - value of pointer - in memory edit
So what to it will be show how on Qt instead of printf address and then pass those address to memory edit ? Because when open memory edit, it is address of pointer - not address pointer points to.