1. 首页
  2. 数据库
  3. 其它
  4. c++ 编程练习 014:MyString

c++ 编程练习 014:MyString

上传者: 2021-01-17 04:30:11上传 PDF文件 39.51KB 热度 18次
北大程序设计与算法(三)测验题汇总(2020春季) 描述 补足MyString类,使程序输出指定结果 #include #include #include using namespace std; class MyString { char * p; public: MyString(const char * s) { if( s) { p = new char[strlen(s) + 1]; strcpy(p,s); } else p = NULL; } ~MyString() { if(p) delete [] p; } // 在此处补充你的代码 }
下载地址
用户评论