C++
Programming and Technical
Programming
Definition
What are virtual classes?
Read Solution (Total 1)
-
- A// base class(display())
B C// B and C child class of A
D// D inheriting from B and C
Now when D d// object of d is made and a call to display() method is made C++ compiler gets confused as it does not know whether to call display() from B or C. So if the class A is made virtual then only 1 subobject will be inherited by B and C, so no ambiguity arises - 8 years agoHelpfull: Yes(0) No(0)
C++ Other Question