CComlpex& Operator () (const CComlpex& C1, const CComlpex& C2)
{
Return CComlpex (c1. Real + c2. Real, c1. Image + c2. The image).
}
CodePudding user response:
Quotation marks just shows function returns a reference type, rather than the value of the copy,CodePudding user response:
Please tell me the detail the overloading, or don't understandCodePudding user response:
After the return value to add reference operator & amp; Because there is no copy the return value, on the contrary, returns the object itself, for example:Int& ABC (int a, b int, int, c int& The result)
{
Result=a + b + c;
return result;
}//right
Int& ABC (int a, b int, int) c
{
return a + b + c;
}//wrong, for copying the return value