#include #include using namespace std; class C { friend bool operator==(C lValue, C rValue ); friend bool operator==(C lValue, int rValue ); friend ostream& operator<<(ostream& output, const C& c); friend istream& operator>>(istream& input, const C& c); friend C operator+(C lValue, C rValue ); public: C():x(0){} C(int i):x(i){} C& operator++(); C operator++(int junk); private: int x; }; bool operator==(C lValue, C rValue ) { return ( lValue.x == rValue.x ); } bool operator==(C lValue, int rValue ) { return ( lValue.x == rValue ); } ostream& operator<<(ostream& output, const C& c) { output << c.x; return output; } istream& operator>>(istream& input, const C& c) { input >> c.x; return input; } C& C::operator++() { x++; return *this; } C C::operator++(int junk) { C result = *this; x++; return result; } C operator+(C lValue, C rValue ) { C result(lValue.x + rValue.x); return result; } void main() { }