Hello there I am having some trouble with the coding of a complex calculator. I overload the operators (+-*/) to enable the calculation of complex numbers. At this point I don't understand why the compiler replies an error to me.
This is for adding a complex number to a double value like:
3 + 3+i2 or 3.7 + 3+i3
the private attributes are set to double. I declared this method outside the class because the left operant (a) isn't part of class 'complex'
I init a object of complex named temp and add the complex number and a double which is saved in temp.re
Now I declared this outside the class
1 2 3 4
complex operator+(double a, complex b);
complex operator-(double a, complex b);
complex operator*(double a, complex b);
complex operator/(double a, complex b);
and those inside the class. Compiler is ok with that just have to test if it is working properly.