Which of the following would be an appropriate function declaration to add two rational numbers?
A) void friend operator+ const Rational &left, const Rational &right) ;
B) void operatator+ const Rational &left, const Rational &right) ;
C) friend Rational operator+ const Rational &left, const Rational &right) ;
D) Rational operator+ const Rational &left, const Rational &right) ;
Correct Answer:
Verified
Q20: Friend functions are members of the class.
Q21: Write the function declaration for a copy
Q22: If c is a character variable that
Q23: Write the function declaration for an assignment
Q24: Who can access private data in a
Q26: To overload functions with symbolic names like
Q27: Operators can be overloaded as
A) friends of
Q28: Given the following class, which is the
Q29: The assignment operator must be a _
Q30: When overloading an operator, which of the
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