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.


When defined as a member function, how many parameters does the unary '!' operator function take?

  1. 0

  2. 1

  3. 2

  4. It depends on the specific use case

The correct answer is: 0

The unary '!' operator function is a member function that takes in 0 parameters. This function is used to negate a given boolean expression, and in this case, does not require any additional parameters to do so. The other options are incorrect because B, C and D refer to the operator function as a non-member function, where the number of parameters may vary depending on the specific use case. Option B and C refer to the number of parameters in a non-member function syntax, while option D highlights that, as a non-member function, the number of parameters may vary depending on the specific use case. However, for the specific use case of a member function, the correct answer is 0.