• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

C++ | Virtual Functions | Question 1

Which of the following is true about virtual functions in C++.

(A)

Virtual functions are functions that can be overridden in derived class with the same signature.

(B)

Virtual functions enable run-time polymorphism in a inheritance hierarchy.

(C)

If a function is \'virtual\' in the base class, the most-derived class\'s implementation of the function is called according to the actual type of the object referred to, regardless of the declared type of the pointer or reference. In non-virtual functions, the functions are called according to the type of reference or pointer.

(D)

All of the above

Answer

Please comment below if you find anything wrong in the above post
Feeling lost in the world of random DSA topics, wasting time without progress? It's time for a change! Join our DSA course, where we'll guide you on an exciting journey to master DSA efficiently and on schedule.
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 geeks!

Last Updated :
Share your thoughts in the comments