死了,书上都有的啊:
Complex operator+(const Complex &z1,const Complex &z2)
{
Complex temp; temp.x=z1.x+z2.x;
temp.y=z1.y+z2.y; return temp;
}
Complex operator+(const Complex &z1,const Complex &z2)
{
Complex temp; temp.x=z1.x+z2.x;
temp.y=z1.y+z2.y; return temp;
}
{
Complex temp; temp.x=this->x+z.x;
temp.y=this->y+z.y; return temp;
}