Question 79Asked in BPSC TRE 2.0 (2023) Computer Class 9-10What is virtual inheritance in C++?
- AC++ technique to enhance multiple inheritance
- BC++ technique to ensure that a private member of the base class can be accessed somehow
- CC++ technique to avoid multiple copies of the base class into children/derived class
- DMore than one of the above
- ENone of the above
Show answerHide answer
Correct answer: (C) C++ technique to avoid multiple copies of the base class into children/derived class
Explanation
Virtual inheritance makes derived classes share one copy of a common base class, which avoids duplicate copies in diamond-shaped inheritance.