#include<iostream>
using namespace std;
#include<math.h>
class complex {
float real, image;
public:
complex(float r = 0, float i = 0)
{
real = r; image = i;
}
complex & operator+=(complex b)
{
real += b.real;
image += b.image;
return *this;
}
complex operator*=(complex b)
{
real += b.real;
image += b.image;
return *this;
}
void display()
{
cout << real << (image >= 0 ? '+' : '-') << "j*" << fabs(image) << endl;
}
};
int main() { return 0; }
Can you show me the diffence of complex operator*=(complex b) and complex & operator+=(complex b)
Thanks you very much !