c++ - Singleton class pointer assignment doesn't work -



c++ - Singleton class pointer assignment doesn't work -

i have class abc singleton.(this c++) when

abc *b = abc::getinstance(); abc* a; a=b;

then when check in debugger value of b not assigned a.

in debugger value of shown 0x00000000 , garbage values members of abc (vs 2008 debugger)

i did *b in debugger watch window , see valid values, when *a see null , garbage values (this after above process over)

a , b pointers.

the address point same, although specific address different.

one other reason might you're debugging in release mode, , you're not using variable a afterwards. in case, compiler can decide omit declaration , assignment of a.

c++ singleton

Comments

Popular posts from this blog

delphi - blogger via idHTTP : error 400 bad request -

c++ - compiler errors when initializing EXPECT_CALL with function which has program_options::variables_map as parameter -

How do I check if an insert was successful with MySQLdb in Python? -