Single inheritance in C++-Types of inheritance

The inheritance

Types of inheritance

There are the following types of inheritance.

  1. Single inheritance
  2. Multiple inheritance
  3. Multilevel inheritance
  4. Hierarchical inheritance
  5. Hybrid inheritance
  6. Multi-path inheritance

In this blog post, you will learn single inheritance.

The type of inheritance in which there is a single base class and a single derived class is called single inheritance

I repeat-: single base class and single derived class…

Leave this syntax, if this confuses you.


Class derived:(visiblility mode)base




Now, we are going to write a program for single inheritance.

We need one base class.

As well as one derived class..

And we are going to access the base class members from derived class…..using this method

  1. Inside both fxns of derived class, we will call the base class functions as base::fxn name();
  2. In the main function, we make a object of derived class


This method was also called as accessing the overridden members of a base class with the members functions of a base class.


Source code:



enter the name of an employee


enter the salary of an employee


enter the title of a manager






title of manager=



Leave a Comment

Your email address will not be published. Required fields are marked *

Do NOT follow this link or you will be banned from the site! Scroll to Top