1234567891011121314
class myClass { private: static int refCount; public: myClass():refCount(0) { refCount++; } ~myClass() { refCount--; } };