首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下程序: #include<iostream> using namespace std; class Amount{ int amount; public: Amount(int n=0):amount(n)
有如下程序: #include<iostream> using namespace std; class Amount{ int amount; public: Amount(int n=0):amount(n)
admin
2017-10-17
17
问题
有如下程序: #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
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
类内部定义的______和______数据不能被不属于该类的成员函数来存取,定义为______的数据,可以在类外部进行存取。
所有的函数模板定义都是以关键字______开始的,该关键字之后是用______括起来的形式参数表。
程序文件的编译错误分为______和______两类。
有如下程序:#include<iostream>usingnamespacestd;classAA{public:virtualvoidf(){cout<<
有如下类的定义。那么空格处的语句是()。classMyClass{____________intx,y;public:MyClass(intx1=0,inty1=0){
在析构函数中调用虚函数时,采用_____联编。
如果一个对象部分地包含自己,或自己定义自己,则称这个对象是【 】的对象。
下列不是循环语句的是
下列字符串中,正确的C++标识符是()。
下列选项中,正确的C++标识符是
随机试题
饮酒后驾驶机动车的,公安机关交通管理部门不得扣留驾驶证。
完成反应式
男,45岁。进行性呼吸困难半年。无咳嗽,咯血及胸痛。查体:BP110/75mmHg,口唇发绀,颈静脉怒张。双肺呼吸音清,心界无扩大,心率92次/分。P2亢进,三尖瓣区可触及抬举样搏动。双下肢轻度水肿。为明确诊断,首选的检查是
肝功能不全者忌用
(注册会计师考试)甲公司为购买货物而将所持有的汇票背书转让给乙公司,但因担心以此方式付款后对方不交货,因此在背书栏中记载了“乙公司必须按期保交货,否则不付款”的字样,乙公司在收到票据后没有按期交货。根据票据法律制度的规定,下列表述中,正确的是(
关于法人的说法,正确的是()。
在商业发票上必须明确显示数量、单价、总值和贸易术语等主要内容。()
从运动生理学氧的代谢程度来看,健康有效的运动项目可分三大类,即()。
市场的基本功能是()。
从所给四个选项中,选择最合适的一个填入问号处,使之呈现一定的规律性。
最新回复
(
0
)