题目内容
class Complex{public:Complex( ){real=0;imag=0;}Complex(double r, double i){real=r;imag=i;}Complex operator+ (Complex c2);private:double real; //实部double imag; //虚部};Complex Complex::operator+ (Complex c2){ Complex temp;temp.real=this->real+c2.real;temp.imag=this->imag+c2.imag;return temp;}int main(){ Complex c1(3,4),c2(5, -10);Complex c3;——————————//c3是c1与c2的和return 0;};请回答:所填写语句中两个操作数通过对象给出的是(),通过参数给出的是()。
查看答案
搜索结果不匹配?点我反馈
更多问题