Static Data Members in C++

A data member of a class can be qualified as static (storage-class). The properties of a static member variable are similar to that of a C static variable. Read more about storage classes in C (Click here) In addition, a static member variable (of a class) has certain special characteristics which are detailed as follows: It is initialized to zero when the first object of its class is created. No other initialization is permitted Only one copy of that member is created for the entire class and is shared by all the objects of that class, no matter how many objects are created It is visible only within the class, but its lifetime is the entire program Static variables are normally used to maintain values common to the entire class. For example, a static data member can be used as a counter that records the occurrences of all the objects....