The data member of a class can be declared as static.
A static members variables certain special characteristics
it is initialized to zero when the first object of its class is created.
only one copy of that member is created for the entire class and is shared by all the objects, no matter how many objects are created.
it is visible only within the class but its lifetime is entire program.
Type and scope of each static member must be defined outside the class.<data type> <class name> :: <variable name>
A static members variables certain special characteristics
it is initialized to zero when the first object of its class is created.
only one copy of that member is created for the entire class and is shared by all the objects, no matter how many objects are created.
it is visible only within the class but its lifetime is entire program.
Type and scope of each static member must be defined outside the class.<data type> <class name> :: <variable name>
Tags:
Cpp