I've created a class of complex numbers and defined operations. I've also defined the imaginary unit i as constant in a namespace. When I write
1 2 3
complex z(0,0)
z = z + 2 + i
z = i
Everything works fine. But when I write z = 2 + i , the compiler gives me the error saying Invalid operands to binary expressions ('const complex' and 'int').
Where is my error?
EDIT :
Here is the implementation of the = and + operators in complex.cpp