J
john134
Complex Complex:perator+( const Complex &operand2 ) const {
return Complex( real + operand2.real,
imaginary + operand2.imaginary );
}
this is my addition operator for 2 complex numbers. e.g. C1(3.2, 1.5)
C2(2.1, 4.6) C1+C2 = (5.3, 6.1) How can i overload the operator+ to
make an addition between a double and a complex number? for example 3.0
+ C1 = (6.2, 1.5) Thanks.
return Complex( real + operand2.real,
imaginary + operand2.imaginary );
}
this is my addition operator for 2 complex numbers. e.g. C1(3.2, 1.5)
C2(2.1, 4.6) C1+C2 = (5.3, 6.1) How can i overload the operator+ to
make an addition between a double and a complex number? for example 3.0
+ C1 = (6.2, 1.5) Thanks.