I have one question about static and non-static function and variable.
1) non-static function access static variable.
It\'s OK!
class Bar
{
publ
For this, you need to understand what is static.
Static data members exist once for the entire class, as opposed to non-static data members, which exist individually in each instance of a class. They will have a class scope and does not bound to an instance of the class.
To access static member of the class, we use the format as below ::
if you have created 10 objects of a class. Assume, you were able to access the non-static variable in the static member of the class, When the static function is called, which object's member it needs to change?