Category: Protected Inheritance in C++

Protected-Inheritance-in-Cpp 1

Protected Inheritance in C++

Understanding the concept of Protected Inheritance in C++. A special mention of visibility label protected: We have just seen how to increase the capabilities of an existing class without modifying it. We have also seen that a private member of a base class cannot be inherited and therefore its is not available for the derived class directly. What do we do if the private data needs to be inherited by a derived class? This can be accomplished by modifying the visibility limit of the private member by making it public. But, this would make it accessible to all the other...