Essay
Show how to overload the operators << and >> to create stream output for this class.
Make these functions friends of the class Pair.The expected form of a pair is (2,3)for both input and output.To make this problem manageable,you should only provide to accept and discard the parentheses and comma,but you should not check that these particular characters were typed.Output should be the expected form.
class IntPair
{
int first;
int second;
public:
IntPair(int firstValue,int secondValue);
int getFirst( )const;
int getSecond( )const;
};
Correct Answer:

Verified
#include <iostream>
using namespac...View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Correct Answer:
Verified
using namespac...
View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Q21: An operator overloading is essentially a function
Q22: Overloading an operator cannot change the precedence
Q23: A class can have friends that are
Q24: When an operator is overloaded as a
Q25: An overloaded operator[] must be a non-static
Q26: Why have we not needed to overload
Q27: You can change the behavior of +
Q28: Overloaded operator <<,when used as an output,returns
Q29: Overloading a binary operator as a member
Q30: What objections to the use of friend