北京科技大学2015年C期末考试复习资料.pptVIP

  • 51
  • 0
  • 约 23页
  • 2017-06-06 发布于四川
  • 举报

北京科技大学2015年C期末考试复习资料.ppt

填空题 在一个类中,成员按访问控制可分为public 、 protected和______________三类。 private 自测练习 填空题 设int i=1; char *s=“a\045+045\’b”; 执行语句 for(i=0;*s++;i++); 后,i的值是_____________。 8 自测练习 填空题 执行语句 int i=1; while(i++5); 后,i的值是_____________。 6 自测练习 读程序写结果 下面程序的运行结果是________。 #include iostream #include string using namespace std; class person {private: int age; char *name; public: person(char *str,int i) {int j=strlen(str)+1; name=new char[j]; strcpy(name,str); age=i+1; } ~person() { delete name; cout”destructor is called!”

文档评论(0)

1亿VIP精品文档

相关文档