c++运算符重载为何complex operator+(complex &a,complex &b)也对,complex operator+(complex &a)也对
来源:学生作业帮助网 编辑:作业帮 时间:2024/08/28 23:17:50
![c++运算符重载为何complex operator+(complex &a,complex &b)也对,complex operator+(complex &a)也对](/uploads/image/z/12244650-42-0.jpg?t=c%2B%2B%E8%BF%90%E7%AE%97%E7%AC%A6%E9%87%8D%E8%BD%BD%E4%B8%BA%E4%BD%95complex+operator%2B%28complex+%26a%2Ccomplex+%26b%29%E4%B9%9F%E5%AF%B9%2Ccomplex+operator%2B%28complex+%26a%29%E4%B9%9F%E5%AF%B9)
x)K~uӟYOvzwjr~nANjB~AjQbI~LD-QL|s;u)I*ҧuv6T4S'K',`~leMywY-'=ml'{ 5@gNy@Q za
.Alx#~qAb(%
c++运算符重载为何complex operator+(complex &a,complex &b)也对,complex operator+(complex &a)也对
c++运算符重载为何complex operator+(complex &a,complex &b)也对,complex operator+(complex &a)也对
c++运算符重载为何complex operator+(complex &a,complex &b)也对,complex operator+(complex &a)也对
complex i,j,k;
k = i + j;
如果你的重载函数作为complex类的成员函数,调用的的就是complex operator+(complex &a)
如果的重载函数作为类的友元函数,调用的就是complex operator+(complex &a,complex &b)