Inheritance is the capability of one class to inherit properties from another class. For instance, Student is a class wherefrom class GraduateStudent inherits as given below:
class Student
{
protected:
char name[25];
int rollno;
public:
void readStudent();
void showStudent();
};
class GraduateStudent:protected Student
{
protected:
char subjects[50];
public:
void readAradStud();
void showGradStud();
};