首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下类定义: class Point { public: Point(int x=0,int y=0){_x=x; _y=y;} void Move(int x Off, int y Off) {_x+=x Off
有以下类定义: class Point { public: Point(int x=0,int y=0){_x=x; _y=y;} void Move(int x Off, int y Off) {_x+=x Off
admin
2010-03-29
25
问题
有以下类定义: class Point { public: Point(int x=0,int y=0){_x=x; _y=y;} void Move(int x Off, int y Off) {_x+=x Off; _y+=y Off; } void Print() const { cout <<’(’ << _x << ’,’ << _y << ’)’<< end 1;} private: int _x,_y; }下列语句中会发生编译错误的是______。
选项
A、Point pt; pr. Print();
B、const Point pt; pt. Print();
C、Point pt; pt. Move(1,2);
D、const Point pt; pt. Move(1,2);
答案
8
解析
const 修饰符改变值出错。
转载请注明原文地址:https://kaotiyun.com/show/tIjp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
请编写函数fun,其功能是求出数组的最大元素在数组中的下标并存放在k所指的存储单元中。例如,输入如下整数:876675896101301401980431451777则输出结果为:6,980注意:部分源程序在文
有以下程序:#includeintfun(){staticintm=l;retumm*=3;}main(){inti=2,s=1;while(i一一)s=fun();printf(’’%d\n’’,s);}程序运行后的输出结
下列程序的输出结果是()。#includemain()voidfun(int*a,int*b){inta=1,b=2,*x=&a,*y=&b;{int*k;fun(x,y);
下列选项中不属于结构化程序设计原则的是
若有定义:inta=1,b=2,c=3;,则执行表达式(a=b+c)||(++b)后,a,b,c的值依次为()。
在长度为n的顺序表中查找一个元素,假设需要查找的元素一定在表中,并且元素出现在表中每个位置上的可能性是相同的,则在平均情况下需要比较的次数为()。
若有以下函数首部intfun(doublex[10],int*n)则下面针对此函数的函数声明语句中正确的是
下列关于逻辑运算符两侧运算对象的叙述中正确的是()。
在C++语言中,数据封装要解决的问题是
随机试题
使用乙炔气瓶时,环境温度不应超过()。
A.短效巴比妥类B.苯巴比妥C.水杨酸类D.甲醇E.锂血液灌流可清除
淋巴瘤最重要的临床特征是
在护理健康教育中,下列哪一种不属于知识灌输方法()。
[2010年,第99题]将二进制小数0.1010101111转换成相应的八进制数,其正确结果是()。
下列关于多功能桥式起重机安全措施的说法,错误的是()。
青海玉树地震期间。干警王伟同志不顾亲人的遇难而去救别人。你是怎么看待的?
[2016年]已知函数f(x,y)=,则().
(2014下项管)在编制项目沟通计划的过程中,对项目干系人分析的目的不包括______。
上网查询资料时,目前最好用的搜索引擎是
最新回复
(
0
)