Question 79Asked in BPSC TRE 2.0 (2023) Computer Class 9-10

What is virtual inheritance in C++?

  1. AC++ technique to enhance multiple inheritance
  2. BC++ technique to ensure that a private member of the base class can be accessed somehow
  3. CC++ technique to avoid multiple copies of the base class into children/derived class
  4. DMore than one of the above
  5. 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.

From BPSC TRE 2.0 (2023) Computer Class 9-10 — Previous Year Paper

This is question 79 of BPSC TRE 2.0 (2023) Computer Class 9-10 — Previous Year Paper. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.