DATA
MEMBERS AND MEMBER FUNCTION IN C++
The
variables declared in a class are called data members. These are also
known as member variables.
Member
functions are the functions declared within class. The member
functions have the accessibility of every element of the class.
Restrictions
applied to class members:
-
A non-static member variable cannot have an initializer.
-
No member can be an object of the class that is being declared.
-
No member can be declared as auto, extern, or register.
No comments:
Post a Comment