Solved

Given the Class Definition

Question 10

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