In C++ Single inheritance, one base class is derived from one sub class. Hence the two related classes (Base & Sub class) exhibit one to one relation.

Block Diagram of Single Inheritance in C++

Syntax of Single Inheritance in C++

Example for Single Inheritance in C++

Output

Output of Single Inheritance Program

Single Inheritance is the simplest form of C++ Inheritance. The most important point to note is that only those members of the base class can be accessed in the derived class which is declared/specified as public. Private data members or members method cannot be accessed in the derived class (sub class).

This Post Has One Comment

  1. Greeting of the day!

Leave a Reply

Close Menu