I have a class ABC which is singleton.(This is C++)
When I do
ABC *b = ABC::getInstance();
ABC* a;
a=b;
then when I check in debugger the value of b is not assigned to a.
In the debugger the value of a is shown as 0x00000000 and all garbage values for members of ABC (VS 2008 Debugger)
I did a *b in the debugger watch window and I see the valid values, when I do a *a I see all null and garbage values (This is after the above process is over)
aandbare pointers.The address they point to will be the same, although their specific address will be different.
One other reason might be that you’re debugging in release mode, and you’re not using the variable
aafterwards. In this case, the compiler can decide to simply omit the declaration and assignment ofa.