摘要: 阅读全文
posted @ 2019-06-08 21:03 西北逍遥 阅读(347) 评论(0) 推荐(0) 编辑
摘要: #pragma oncetemplate<typename T>class smart_pointer{private: T* m_pRawPointer;public: smart_pointer(T* pData) :m_pRawPointer(pData) {} //复制构造函数 smart_ 阅读全文
posted @ 2019-06-08 20:16 西北逍遥 阅读(155) 评论(0) 推荐(0) 编辑
摘要: try { for (int i = 0; i<1000; i++) { test1 = new Test(); cout << i << " new dog success..." << endl; } } catch (bad_alloc err) { cout << "fail:"<<err. 阅读全文
posted @ 2019-06-08 19:22 西北逍遥 阅读(524) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> using namespace std; const int DefaultSize = 10; class Array{public: Array(int itsSize=DefaultSize); ~Array() { delete[] pType; } 阅读全文
posted @ 2019-06-08 17:34 西北逍遥 阅读(853) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <stdio.h> using namespace std; class IOException{};class FileException{};class UndefineError{}; void my_copy(const char* s 阅读全文
posted @ 2019-06-08 16:54 西北逍遥 阅读(1593) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <stdio.h> using namespace std; void my_copy(const char* src_file, const char* dest_file){ FILE *in_file, *out_file; in_fil 阅读全文
posted @ 2019-06-08 16:42 西北逍遥 阅读(1916) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <stdio.h> using namespace std; int my_copy(const char* src_file,const char* dest_file){ FILE *in_file, *out_file; in_file 阅读全文
posted @ 2019-06-08 16:37 西北逍遥 阅读(362) 评论(0) 推荐(0) 编辑