Question: Given the following class interface class IntPair{ private: int num1; int num2; public: //Question. What's the function prototype to overload the - (subtraction) operator as
Given the following class interface
class IntPair{ private: int num1; int num2; public: //Question. What's the function prototype to overload the - (subtraction) operator as a // member function, which restricts this operator from modifying either of the // operands? This function will return an IntPair object. // If needed, please use lhs or rhs to refer to the left-hand side // or right-hand side operand in your prototype. Also, if you need to pass in // one or more parameters to this function, you are required to pass it by reference. };
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
