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

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

Test your C++ skills with our quiz based on Bruce Eckel's 'Thinking in C++'. Dive into object-oriented programming, advanced topics, and fundamentals. Perfect for learners and experts alike. Assess your knowledge and become a C++ master!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


What do virtual functions enable in C++?

  1. Early binding

  2. Late binding

  3. Static typing

  4. Compile-time polymorphism

The correct answer is: Late binding

Virtual functions enable late binding in C++. This means that the function to be executed is determined at runtime based on the type of the object it is invoked on, rather than at compile time. Option A is incorrect because early binding refers to the decision being made at compile time, which is not the case for virtual functions. Option C is incorrect because static typing is a characteristic of languages like Java and C#, and is not directly related to virtual functions in C++. Option D is incorrect because compile-time polymorphism, or method overloading, is a feature of the language that enables functions with the same name to be called with different arguments. This is different from the behavior of virtual functions.