1. Home
  2. Computer Science MCQs
  3. C++ and Object-Oriented Programming
  4. Declaring a function virtual in C++ enables:

Added 30 Nov -0001

Declaring a function virtual in C++ enables:

  1. multiple inheritance of data
  2. automatic memory management
  3. runtime polymorphism Correct answer
  4. compile-time polymorphism

Correct answer

C. runtime polymorphism

12 views

MCQSEXAM

Explanation

Virtual functions allow the correct overriding function to be chosen at run time through a base-class pointer.

Reference

Asked in: NTS, PPSC IT, Campus Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is C? 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