User-Defined Data Types
We can also set our own preferences for the input and output operators.
We'll cover the following...
If we overload the input and output operators, our data type behaves like a built-in data type.
Press + to interact
friend std::istream& operator>> (std::istream& in, Fraction& frac);friend std::ostream& operator<< (std::ostream& out, const Fraction& frac);
For overloading the input and output operators, we have to keep a few rules in mind: