首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
使用VC6打开考生文件夹下的源程序文件modil.cpp,该程序运行时有错,请改正其中的错误,使程序正确运行,并且使程序输出的结果为: CMyObject,in the construtor CMyObject,in the destrut
使用VC6打开考生文件夹下的源程序文件modil.cpp,该程序运行时有错,请改正其中的错误,使程序正确运行,并且使程序输出的结果为: CMyObject,in the construtor CMyObject,in the destrut
admin
2020-07-23
50
问题
使用VC6打开考生文件夹下的源程序文件modil.cpp,该程序运行时有错,请改正其中的错误,使程序正确运行,并且使程序输出的结果为:
CMyObject,in the construtor
CMyObject,in the destrutor
注意:错误的语句在∥********error********的下面,修改该语句即可。
#include
class CMyObj ect
{
∥********error********
∥********error********
CMyObj ect{cout<<“CMyObj ect,in the construtor”<
~CMyObj ect(){cout<<
”~CMyObject,in the deStrutor”
<
},
void main()
{
CMyObj ect obj 1;
}
选项
答案
(1)添加语句:public: (2)CMyObj ect(){cout<<“CMyObj ect,in the construtor”<
解析
程序中定义了类CMyObject,含有一个构造函数和一个析构函数,在构造函数和析构函数中分别输出一段字符。
转载请注明原文地址:https://kaotiyun.com/show/lLyp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
有如下类定义:classSample{public:Sample(intx):ref(x){}//1private:Sample(){ref=0;}//2staticintval
有如下程序:#includeusingnamespacestd;classBase{public:Base(){cout
有如下类定义:classB{public:voidfun1(){}private:voidfun2(){}protected:voidfun3(){}};classD:publicB{protect
有如下程序:#includeusingnamespacestd;void_________{intz=x;x=y;y=z;}intmain(){int
下列有关继承和派生的叙述中,正确的是()。
关于函数重载,下列叙述中错误的是()。
在软件开发中,需求分析阶段可以使用的工具是( )。
下面是重载为非成员函数的运算符函数原型,其中错误的是
有如下语句序列:charstr[10];cin>>str;当从键盘输入“Ilovethisgame”时,str中的字符串是()。
随机试题
《国家行政机关公文处理办法》第十条规定,在文件上应注明签发人、会签人姓名的是()
瓜蒌皮与浙贝母都可治疗的病证是
背景某通信运营商计划在某地建设3G试验网,工程由只有设备入网资质的3G设备生产厂商编制了初步设计,工程估算价在280万元,此初步设计经研究得到批准。该运营商决定采用包工不包料的形式将此项目承包给一家长期合作的施工单位,并请施工单位选定基站的站址,然后由设
期货交易所应当及时公布的上市品种合约信息不包括()。
伪造、变造会计凭证、会计账簿,向股东和社会公众提供虚假的财务会计报告,严重损害股东或者其他人利益,构成犯罪的,根据《刑法》的规定,对其直接负责的主管人员和其他直接责任人员可以处以的刑罚是( )。
Walmartisatan"inflectionpoint".ThosewordsaretruernowthanwhenBillSimon,theheadofitsAmericanoperation,uttered
【B1】【B3】
ThisiscensusyearinAmerica,andalthoughwehesitatetopre-empttheresultsofamightyexercisethatwillinvolveoveram
Americansdependontheircarsmorethananyotherpeople.Thefamilycarhasbeenacommonthingsincetheearly20thcenturya
Oneofthegreatestconcernsparentshavewhenfacinganinternationalmoveis,"Whatschoolwillbe【C1】______tomychild?Will
最新回复
(
0
)