What is difference between static data member and ordinary data member of the class?
Answers
Answered by
5
hey here is your answer
Static members are declared using “static” keyword. These members are automatically initialised to 0 on declaration. The major difference between static members and normal members is that each object has separate copy of normal variables when multiple objects are created but only one copy of static variable is created and shared by all objects. Only one copy of these variables is created by class for all objects
Static members are declared using “static” keyword. These members are automatically initialised to 0 on declaration. The major difference between static members and normal members is that each object has separate copy of normal variables when multiple objects are created but only one copy of static variable is created and shared by all objects. Only one copy of these variables is created by class for all objects
Similar questions