Also when using classes, a static member variable is one that is shared among members of the class, and must be initialised at file scope:Then static member functions, which don't have a this pointer and are not allowed to reference any non-static member variables or functions:Code:class NewClass { public: static int m_iShared; }; NewClass::m_iShared = 5;Code:class OtherClass { public: static int MyStaticFunction(int x) { return x + 1; } };




Reply With Quote