Is global memory initialized in C++? And if so, how?
(Second) clarification:
When a program starts up, what is in the memory space which will become global memory, prior to primitives being initialized? I'm trying to understand if it is zeroed out, or garbage for example.
The situation is: can a singleton reference be set - via an instance()
call, prior to its initialization:
MySingleton* MySingleton::_instance = NULL;
and get two singleton instances as a result?
See my C++ quiz on on multiple instances of a singleton...
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…