Virtual Base Class in C++

Virtual Base class is used to resolve the ambiguity in inheritance. While inheriting the base class data there may be a some situation where it may generate an error to access the base class data. Lets check a situation first and after we will discuss the answer for, what is base class ? and why it is used? Scenario 1: Consider a situation, where all the three kinds of inheritance, namely multi-level, multiple and hierarchical are involved. Let us say the ‘ClassD‘ has two direct base classes ‘ClassB’ and ‘ClassC’…

Read More