Question: Cpp Considering the following class class Class1{ public: Class1(); int getX(); int getY(); int setX(int); int setY(int); void operator +=(Class1 &tmp); int operator *(int n);
Cpp
Considering the following class
class Class1{
public: Class1();
int getX();
int getY();
int setX(int);
int setY(int);
void operator +=(Class1 &tmp);
int operator *(int n);
void operator *=(Class1 &tmp);
Class1 *operator+(Class1 &tmp);
private: int x;
int y;}
Implement the *= operator that should work x*=B.x; y*=B.y;
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
