C程序设计教程面向对象分册郑秋生完整答案.docVIP

  • 22
  • 0
  • 约1.6万字
  • 约 45页
  • 2019-06-27 发布于浙江
  • 举报

C程序设计教程面向对象分册郑秋生完整答案.doc

第1章 类和对象 一、 选择题 1.C 2.B 3.C 4.A 5.C 6.A 7.C 8 C 9A 10 C 二、阅读题 1.x=2,y=3 2.x=2,y=3 x!=y 3. Cstatic::va1=0 cs1.vaI=1 cs2.val=2 cs1.val=4 cs2.vaI=4 四、改错题 #include string.h #include iostream.h class person { public: person(int n,char* nam,char s { num=n; strcpy(name,nam; sex=s; coutConstructor called.endl; } ~person( { coutDestructor called.endl; } void display( { coutnum: endl ; coutname: endl ; coutsex: endl endl ; } private: int num; char name[10]; char sex; }; int main( { person s1(10010,Wang_li,f; s1.display( ; person s2(10011,Zhang_fun,m; s2.display( ; return 0; } 五、编程题 5

文档评论(0)

1亿VIP精品文档

相关文档