Solved

Given the Class Definition

Question 21

Essay

Given the class definition:
class A
{
public:
//constructors
// other members
private:
int x;
int y;
};
Give declarations of operator functions for each of the following ways to overload operator + You must state where the declaration goes,whether within the class in the public or private section or outside the class.The operator + may be overloaded
a)as friend function
b)as member function
c)as non-friend,non-member function

Correct Answer:

verifed

Verified

a)To overload operator+ friend function:...

View Answer

Unlock this answer now
Get Access to more Verified Answers free of charge

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