有如下程序:    #include<iostream>    using namespace std;    class Amount{      int amount;    public:      Amount(int n=0):amount(n)

admin2017-10-17  22

问题 有如下程序:    #include<iostream>    using namespace std;    class Amount{      int amount;    public:      Amount(int n=0):amount(n){}      int getAmount()const{return amount;}      Amount&operator9=(Amount a){        amount+=a. amount;        return______;      }    };    int main(){      Amount x(3),y(7);      x+=y,      cout<<x. getAmount()<<endl;      return 0;    }已知程序的运行结果是10,则下划线处缺失的表达式是

选项 A、* this
B、this
C、&amount
D、amount

答案A

解析
转载请注明原文地址:https://jikaoti.com/ti/VBt0FFFM
0

随机试题
最新回复(0)