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

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

Challenge your C++ knowledge with a comprehensive quiz based on 'Thinking in C++'. Explore a variety of multiple choice questions with hints and explanations to solidify your understanding. Get prepared!

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 keyword is used in C++ to indicate that a function does not return a value?

  1. null

  2. void

  3. empty

  4. none

The correct answer is: void

The keyword "void" is used in C++ to indicate that a function does not return a value. Options A, C, and D are incorrect because they are either not keywords in C++ or do not accurately describe a function that does not return a value. For example, "null" is not a keyword in C++ and "empty" and "none" do not explicitly indicate that a function does not return a value. Therefore, "void" is the best keyword to use in this scenario.