面向对象程序设计期末综合练习四(运行结果)创新.docVIP

  • 22
  • 0
  • 约1.31万字
  • 约 18页
  • 2016-06-07 发布于湖北
  • 举报

面向对象程序设计期末综合练习四(运行结果)创新.doc

面向对象程序设计期末综合练习四(运行结果) 写出程序运行结果 28. #includeiostream.h #includestring.h class CD { char* a; int b; public: void Init(char* aa, int bb) { a=new char[strlen(aa)+1]; strcpy(a,aa); b=bb; } char* Geta() {return a;} int Getb() {return b;} void Output() {couta bendl;} } dx; void main() { CD dy; dx.Init(abcdef,30); dy.Init(shenyafen,3*dx.Getb()+5); dx.Output(); dy.Output(); } 29.#includeiostream.h #includestring.h class CD { char* a; int b; public: v

文档评论(0)

1亿VIP精品文档

相关文档