Discussion
If an arithmetic assignment operator is overloaded in C++ programming the result :
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.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development