1. Home
  2. Computer Science MCQs
  3. C++ and Object-Oriented Programming
  4. Which problem does a virtual base class address?

Added 30 Nov -0001

Which problem does a virtual base class address?

  1. Duplicate base subobjects in diamond inheritance Correct answer
  2. Virtual calls made on const objects
  3. Leaks caused by missing virtual destructors
  4. Ambiguity between overloaded operators

Correct answer

A. Duplicate base subobjects in diamond inheritance

12 views

MCQSEXAM

Explanation

A virtual base is shared by every path of the hierarchy, so a diamond keeps exactly one copy of it.

Reference

Asked in: NTS, PPSC IT, Campus Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is A? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More C++ and Object-Oriented Programming MCQs

Practise all C++ and Object-Oriented Programming MCQs

Similar MCQs