printf("%u%s",pGlobal,d);
If you compile that line as 64 bit code, it will likely cut off the 64 bit pointer type to 32 bit. So it may be that the '0' you are seeing is just the upper 32 bits of the pointer rather than the (more meaningful) lower 32 bits.
If you want to print a pointer address using
printf
, use the format specifier
%p
, not
%u
! See
http://www.cplusplus.com/reference/cstdio/printf/[
^]