20.A program to demonstrate how a protected data of a base class is accessed by the public member function of the derived class through friend class declaration. The derived class has been inherited...





20.A program to demonstrate how a protected data of a base class is accessed by the public member function of the derived class through friend class declaration. The derived class has been inherited via public inheritance



21.The following program shows that an error is encountered as a result of an attempt to access the protected data of the base class by the public member function of the derived class via private inheritance. Because of the private derivation, the base class members cannot be accessed by the public members of the derived class even though it has a friendship with base class.








May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here