C++ Practice Quiz 2025 – Complete Exam Prep Based on 'Thinking in C++'

Disable ads (and more) with a premium pass for a one time $4.99 payment

Question: 1 / 565

Which of the following is NOT defined as a friend function in the Integer class?

operator+()

operator-()

operator%()

operator++()

A friend function in the Integer class is a function that is external to the class but has access to its private members. This allows the function to operate on an object of the Integer class as if it were a member of the class. In this case, all of the options listed are defined as friend functions in the Integer class except for operator++(), which is defined as a member function. The other options are incorrect because they are either not defined as functions in the Integer class or they are not declared as friends of the class. Therefore, D is the correct answer as it is the only option that is not defined as a friend function in the Integer class.

Get further explanation with Examzify DeepDiveBeta
Next

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy