Examveda

What happens if a derived class inherits multiple base classes and each base class contains a member with the same name in C++?

A. The member of the derived class must explicitly specify which base class member to access

B. The member of the derived class will access the member from the base class with the same name

C. A compilation error occurs

D. The member of the derived class accesses all members with the same name from all base classes

Answer: Option B


Join The Discussion

Related Questions on Inheritance in C plus plus