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 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.