#include <stdio.h> class aaa { public: static aaa* GetInstance() { if (m_instance == NULL) { m_instance = new aaa(); } return m_instance; } private: aaa(){}; static aaa* m_instance; }; aaa* aaa::m_instance = NULL; int main() { aaa* a = aaa::GetInstance(); aaa* b = aaa::GetInstance(); return 0; }