未分类题

有下列程序: #include<iostream> Using namespace std; Class Amount{ int amount; public; Amount(int n=O):amount(n){} Int getAmount()const{return amount;} Amount &operator+=(AmountA) {
D.amount

A.*this
B.this
C.&amount

【参考答案】

D
解析: 此题考查的是“+”运算符重载和this指针。语句amount+=a.amount;实现3和7的求和,......

(↓↓↓ 点击下方‘点击查看答案’看完整答案 ↓↓↓)