Mastering C++: A Comprehensive Quiz Based on 'Thinking in C++'

Disable ads (and more) with a membership for a one time $2.99 payment

Question: 1 / 50

What keyword is used in C++ to declare a function to support late binding?

virtual

In C++, the keyword "virtual" is used to declare a function that supports late binding. This means that the function can be overridden by a derived class and the binding will occur at runtime instead of at compile time. Options B and C are incorrect because they are not valid keywords in C++. Option D, "override", is a valid keyword in C++ but it is used to explicitly indicate that a virtual function is being overridden. It is not the keyword used to declare a function as virtual.

dynamic

late

override

Next

Report this question