Solved

An Overloaded + Operator Takes a Class Object and a Double

Question 3

Multiple Choice

An overloaded + operator takes a class object and a double as operands. For it to be commutative (i.e., a + b and b + a both work) :


A) operator+ must be a member function of the class from which the objects are instantiated.
B) operator+ must be a non-member function.
C) It must be overloaded twice; the operator+ function that takes the object as the left operand must be a member function, and the other operator+ function must be a global function.
D) The + operator cannot be overloaded to be commutative.

Correct Answer:

verifed

Verified

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents