Possible Duplicate:
Can any one provide me a sample of Singleton in c++?
C++ Singleton design pattern
C++ different singleton implementations
I need some example of Singleton in c++ class because i have never wrote such class.
For an example in java I can declare d a static field which is private and it’s initialize in the constructor and a method getInstance which is also static and return the already initialize field instance.
Thanks in advance.
Example:
logger.h:
logger.c:
more info in:
http://www.yolinux.com/TUTORIALS/C++Singleton.html