未知题型
请使用VC6或使用【答题】菜单打开考生文件夹projl下的工程projl,此工程中含有一个源程碍文件 projl.epp。其中位于每个注释“//ERROR ****found****”之后的一行语句存在错误。请改正这些错误,使程序的输出结果为: ConstruCtor CalleD.The value is 10 Copy ConstruCtor CalleD.The value is 10 DestruCtor CalleD.DestruCtor CalleD.注意:只修改注释“//ERROR ****found****”的下一行语句,不要改动程序中的其他内容。 //pwjl.Cpp inClude<iostream> ’using namespaCe std; Class MyClass{ publiC: //ERROR**********found********** MyClass(int i) {value=i;Cout<<”ConstruCtor CalleD.” <<endl;} //ERROR**********found********** MyClass(eonst MyClass P) { value = P.value; eout<<”Copy ConstruCtor CalleD.”<<endl; } void Print {Cout<<”The value is” <<value<<endl;} //ERROR**********found********* void-MyClass {Cout<<”DestruCtor CalleD.”<<endl;} private: int value; }; int main { MyChas objl owl.Print; MyClmss obj2(owl); obj2.Print; retum 0;
A.epp。其中位于每个注释“//ERRORB.Cpp
C.”
D.value;
E.”<<endl;
F.”<<endl;}
G.Print;
H.Print;
【参考答案】
(1)MyClass(int i=10)
(2)MyClass(eonst MyClass&P)
(3)~MyClass
点击查看答案
相关考题
