Thursday, 29 March 2018

Data member and member function



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:
  1. A non-static member variable cannot have an initializer.
  2. No member can be an object of the class that is being declared.
  3. No member can be declared as auto, extern, or register.

No comments:

Post a Comment

POLYMORPHISM IN C++

POLYMORPHISM IN C++ C++ achieves polymorphism through: i) Function overloading ii)Operator overloading By the...