c++运算符重载为何complex operator+(complex &a,complex &b)也对,complex operator+(complex &a)也对
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/06 08:08:30
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)