The main advantages of inheritance are code reusability and readability . When child class inherits the properties and functionality of parent class, we need not to write the same code again in child class. This makes it easier to reuse the code, makes us write the less code and the code becomes much more readable.
Read moreWhat Cannot be inherited in C++?
In C++, friend is not inherited. If a base class has a friend function, then the function does not become a friend of the derived class(es). Constructors are different from other class methods in that they create new objects, whereas other methods are invoked by existing objects.
Read moreWhat is public/private and protected inheritance in C++?
public inheritance makes public members of the base class public in the derived class, and the protected members of the base class remain protected in the derived class. protected inheritance makes the public and protected members of the base class protected in the derived class.
Read moreWhat are the 5 types of inheritance in C++?
C++ supports five types of inheritance:
Read more