operator overloading
I'm doing an exercise that asks to create a Complex class and to implement sum and sub operator as well as the == operator. I'm confident with the first two, but I can't say the same for the latter. Also, what would you answer to the question: does the class need an assignment operator and a deep copy operator? class Complex { public: Complex():re (0), im(0){}; Complex(double r, double i): re(r), im(i){}; bool operator==(const Complex& right) { bool result = true; if(this != &right){ result = false; } return result; } Complex operator+(const Complex& op) { return Complex(re + op.re, im + op.im); } Complex operator-(const Complex& op){ return Complex(re - op.re, im - op.im); } private: double re; double im; };