面向对象的程序设计c++类与对象演示课件.pptVIP

  • 4
  • 0
  • 约2.67万字
  • 约 116页
  • 2018-03-28 发布于广东
  • 举报

面向对象的程序设计c++类与对象演示课件.ppt

. . #include iostream.h #include string.h class A { char string[50]; public : A(char * st); ~A( ); }; A::A(char * st) { strcpy(string, st); cout string 被创建时调用构造函数 ! endl; } A::~A( ) { cout string 被撤消时调用析构函数 ! endl; } . void fun( ) { cout 在fun( )函数体内 : \n endl; A FunObj(fun( )函数体内的自动对象 FunObj); ? static A InStaObj(内部静态对象 InStaObj); } fun_static.dsw . void main( ) { A MainObj(主函数体内的自动对象 MainObj); cout主函数体内,调用fun()函数前: \n; fun( ); cout \n主函数体内, 调用fun()函数后:\n; } static A ExStaObj(外部静态对象

文档评论(0)

1亿VIP精品文档

相关文档