03 2022 档案
摘要:#include <iostream> using namespace std; char* mystrcpy(char* dest,const char* src) { if(src==nullptr || dest==nullptr) { return nullptr; } char* addr
阅读全文
摘要:#include <iostream> #include <memory>//allocator using namespace std; class String { static allocator<char> alloc; private: char *start; char *first_f
阅读全文
摘要:错误提示1:undefined reference to `StrVec::alloc[abi:cxx11]' 类的静态数据成员需要在类外定义。 解决方式在类外加上代码: allocator<string> StrVec::alloc; 错误提示2:error: passing 'const Str
阅读全文
摘要:#include <iostream> #include <vector> #include <string> #include <set> using namespace std; class Message; class Folder { friend class Message; privat
阅读全文
摘要://两个类实现文本查询 #include <iostream> #include <memory> #include <fstream> #include <vector> #include <string> #include <set> #include <map> #include <sstre
阅读全文
摘要:istringstream报错,错误如下 :variable 'std::istringstream line_stream' has initializer but incomplete type istringstream line_stream(line); 解决方法:包含sstream头文件
阅读全文
摘要:#include <iostream> using namespace std; class Base { public: Base():b(1){} virtual void fun(){}; int b; }; class Son:public Base { public: Son():d(2)
阅读全文