Write a note on static data member and member functions.
Answers
Answered by
0
When we declare a member of a class as static it means no matter how many objects of the class are created, there is only one copy of the static member. A static member is shared by all objects of the class. All static data is initialized to zero when the first object is created, if no other initialization is present.
Answered by
0
Static data member:
Static data members are the variables of a programming language in which we use the keyword static with any variable and that value will remain static or the same with all member functions. If any member function has modified its value, it will be reflected in all member functions.
Member functions:
Static member functions are functions that can be accessed by the static data members or other member functions declared in the same class or by the other static member functions.
Similar questions