(1)+ * += *= ++i i++ Complex Complex::operator+(const Complex &f)const
{
return Complex(f.real+real,f.image+image);
}
Complex Complex::operator *(const Complex &f)const
{
Complex p(real,image);
p.real=real*f.real-image*f.image;
p.image=f.real*image-f.image*real;
return p;
}
Complex &Complex::operator +=(const Complex &f)
{
real+=f.real;
image+=f.image;
return *this;
}
Complex &Complex::operator *=(const Complex &f)
{
real=real*f.real-image*f.image;
image=f.real*image-f.image*real;
return *this;
}
Complex & Complex::operator++()
{
real+=1;
return *this;
}
Complex Complex::operator++(int)
{
Complex p(*this);
real+=1;
return p;
}