问答题
【参考答案】
(A) strcpy(name,nm); strcpy(address,adr);(B) strcpy(name, ne......
(↓↓↓ 点击下方‘点击查看答案’看完整答案、解析 ↓↓↓)
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
问答题
改错题使用VC6打开考生文件夹下的工程test19_1,此工程包含一个源程序文件test19_1.cpp,但该程序运行有问题,请改正程序中的错误,使程序的输出结果如下:1:weight:5age:02:weight:7age:9源程序文件test19_1.cpp清单如下:#include class animal{public: **************** found ******************* friend void setvalue(animal&,int); **************** found ******************* viod print();protected: int itsweight; int itsage;};void animal::print(){ cout<< weight: <<itsweight<<endl; cout<< age: <<itsage<<endl;}void setvalue(animal &ta,int tw){ ta.itsweight=tw; ta.itsage=0;}void setvalue(animal &ta,int tw,int tn){ ta.itsweight=tw; ta.itsage=tn;}void main(){ **************** found ******************* animal peppy setvalue(peppy,5); cout<< 1: <<endl; peppy.print(); setvalue(peppy,7,9); cout<< 2: <<endl; peppy.print();}
点击查看答案&解析
相关试题
简单应用题请编写函数void swap(int *p...