If an arithmetic assignment operator is overloaded in C++ programming the result :
MH SET - 2018, SET Exam - 2018,
Answer: B
The result goes in the object to the left of the operator.
Arithmetic assignment operators such as += and -= modify their left operand. When += is overloaded as a member function, a += b is called as a.operator+=(b): the object on the left is the one that calls the function, and the function changes that object's own data.
The object on the right is only read. The operator may also return a reference to the left object so that assignments can be chained, but returning a result is not required, and the result is stored in the left object whether or not anything is returned.
Please log in or register to report this question.