A

Admin • 833K Points
Coach

Q. What is the purpose of the 'virtual' keyword in C++?

  • (A) To create a constant variable
  • (B) To define a static function
  • (C) To allow function overriding in derived classes
  • (D) To declare a global variable
  • Correct Answer - Option(C)
  • Views: 21
  • Filed under category C++
  • Hashtags:

Explanation by: Admin

In C++, the 'virtual' keyword allows derived classes to override base class functions.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.