C++ Static members
All Articles

Static Class Members in C++

Static data members are used when only one copy of the variable exists and all the objects of that class share that variable. It is mostly used to synchronize various objects accessing a shared variable. Below is a simple C++ program representing this functionality – Static member functions could only access members of a class….