Consider this operator overloading for class Money,modified from Display 8.1 by omitting the const modifier on the return type:
Money operator+(const Money& amt1,const Money& amt2);
Is the following expression legal? If legal,what could it mean,and where does the information that is assigned go?
Money m1(17.99),m2(23.57)m3(15,22);
(m1 + m2)= m3;
Correct Answer:
Verified
Q2: Overloading an operator cannot change the precedence
Q3: When overloading an operator,you can create a
Q4: Overloading a binary operator as a member
Q5: A friend function has access only to
Q6: Overloaded operator <<,when used as an output,returns
Q8: When overloading an operator,you can change the
Q9: An overloaded operator[] must be a non-static
Q10: If a unary operator is overloaded as
Q11: An operator overloading is essentially a function
Q12: It is impossible to get short-circuit behavior
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents