1_4参数传递

2018-01-02  本文已影响0人  hello萌面大婶

1.在常成员函数中,不可以修改类中任意数据成员

double real () const { return re; }       //注意在函数后面加const

2.参数传递----尽量传引用,速度比较快

pass by value

pass by reference(引用)

传引用不希望对象改,在前面加const

complex& operator += (const complex&);

上一篇 下一篇

猜你喜欢

热点阅读