How to achieve multi level inheritance

By Prof. Fazal Rehman Shamil
Last modified on May 4th, 2021

Let’s begin with a simple example to achieve multi-level inheritance.

multivel child parent relationship of classes
Figure: multi-level inheritance

Example to achieve multi-level inheritance in C++

C++ program to print a hollow square or rectangle star pattern by achieving the multi-level inheritance.

Level 0 =  class a

Level 1 = class b: public a (Class b is a child of class a)

Level 2 = class c: public b (Class c is a child of class b)

C++ print hollow square star pattern multi-level inheritance.
C++ print hollow square star pattern multi-level inheritance.

Output

How to achieve multi level inheritance

Topic Covered

How to achieve multi-level inheritance?

Prof.Fazal Rehman Shamil (Available for Professional Discussions)
1. Message on Facebook page for discussions,
2. Video lectures on Youtube
3. Email is only for Advertisement/business enquiries.