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.


How many arguments does a binary operator overload defined as a member function take?

  1. 0

  2. 1

  3. 2

  4. It depends on the operator being overloaded

The correct answer is: 1

A binary operator overload defined as a member function takes one argument. This is because it only requires one operand from the object it is being called upon. The other operand is passed as an argument to the function. The other options are incorrect because an operator overload cannot be defined as a member function without at least one argument, and it cannot take zero or more than two arguments. The correct answer is option B.