03 2022 档案

摘要:#include <iostream> using namespace std; char* mystrcpy(char* dest,const char* src) { if(src==nullptr || dest==nullptr) { return nullptr; } char* addr 阅读全文
posted @ 2022-03-26 14:03 菠萝超级酸 阅读(43) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <memory>//allocator using namespace std; class String { static allocator<char> alloc; private: char *start; char *first_f 阅读全文
posted @ 2022-03-26 13:59 菠萝超级酸 阅读(26) 评论(0) 推荐(0) 编辑
摘要:错误提示1:undefined reference to `StrVec::alloc[abi:cxx11]' 类的静态数据成员需要在类外定义。 解决方式在类外加上代码: allocator<string> StrVec::alloc; 错误提示2:error: passing 'const Str 阅读全文
posted @ 2022-03-25 14:38 菠萝超级酸 阅读(239) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <string> #include <set> using namespace std; class Message; class Folder { friend class Message; privat 阅读全文
posted @ 2022-03-23 22:16 菠萝超级酸 阅读(40) 评论(0) 推荐(0) 编辑
摘要://两个类实现文本查询 #include <iostream> #include <memory> #include <fstream> #include <vector> #include <string> #include <set> #include <map> #include <sstre 阅读全文
posted @ 2022-03-20 16:07 菠萝超级酸 阅读(121) 评论(0) 推荐(0) 编辑
摘要:istringstream报错,错误如下 :variable 'std::istringstream line_stream' has initializer but incomplete type istringstream line_stream(line); 解决方法:包含sstream头文件 阅读全文
posted @ 2022-03-13 15:05 菠萝超级酸 阅读(1268) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> using namespace std; class Base { public: Base():b(1){} virtual void fun(){}; int b; }; class Son:public Base { public: Son():d(2) 阅读全文
posted @ 2022-03-03 11:19 菠萝超级酸 阅读(85) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示