You declared two different versions of the output operators:
istream& operator>>(istream& is, MyIncreEx& s);
ostream& operator<<(ostream &os, MyIncreEx& s);
class MyIncreEx
{
friend istream& operator>>(istream& is, MyIncreEx s);
friend ostream& operator<<(ostream& os, MyIncreEx s);
...
};
The friend
operators have a different and conflicting signature. You probably wanted to declare them as
friend istream& operator>>(istream& is, MyIncreEx& s);
friend ostream& operator<<(ostream& os, MyIncreEx const& s);
(assuming you also fix the output operator to work with MyIncreEx const&
rather than MyIncreEx&
).