Does C++ support Multiple inheritance

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

Question: Does C++ support Multiple inheritance?Multiple inheritance

Answer: Yes, C++ supports the concept of Multiple inheritance between the classes.

In the figure, the class A and class B are the parents of class C.

These concepts can be represented with a simple C++ program. So, let’s begin with the program.

Example of C++ supporting the Multiple inheritance

C++ program to print a hollow square or rectangle star pattern with the support of Multiple inheritance.

In this example, one is the parent of the class of child class. You can run the program as proof that C++ supports the Multiple inheritance.

In the following program Class one and two are the parent of class child.

C++ hollow square or rectangle star pattern Multiple inheritance
C++ hollow square or rectangle star pattern Multiple inheritance

Output

Does C++ support Multiple inheritance