Why we have to declare static member function to access private static variable? Why not simply use a public function to access s_nValue? I mean why is it better to use static member function instead of a non-static public function?
class Something { private: static int s_nValue; }; int Something::s_nValue = 1; // initializer int main() { }
TypeName::Methodname();