单项选择题

有如下程序:
#include<iostream>
Using namespace std;
Class Amount{
int amount;
public;
Amount(int n=0):amount(n){}
Int getAmount()const{return amount;}
Amount &operator+=(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
在线练习
题目列表

你可能感兴趣的试题

微信扫码免费搜题