Ask a Teacher
what are static members in a class? in which aspect do they differ from normal members? |
The static data member of class are globally available to all the objects of the class and hence memory is allocated at link time. The data member should be declared as static data member .Usually memory for each data member will be counted for an object on its declaration.But if the class contains static data member ,its size will not be taken into account for each object .The memory space for static members will be common for all the objects. |