Inheritance
Inheritance in object-oriented programming may be described as a process for creating new classes from existing classes. New classes inherit certain properties and behaviors from existing classes. An existing class is referred to as a base class and a new class is referred to as a derivative class or base class.
A derivative class can be defined by specifying its relation to the base class in addition to its own particulars.
The general form of the definition of the derived class is as follows:
Class derived-class-name : visibility base-class-name { Members of the derived class }
Example:
Class XYZ { public: int a; } Class ABC : private XYZ { private: int b; public: void getdata() { cin>>b; } };