上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 68 下一页
摘要: 1 #include //进程通信,获取未来的结果 2 #include 3 #include 4 #include 5 #include //时间 6 #include //互斥量 7 using namespace std; 8 9 //创建互斥量 10 mutex m; 11 12 //全局通信变量 13 promise val; 14 15 void main... 阅读全文
posted @ 2018-04-01 23:20 喵小喵~ 阅读(299) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 8 //全局通信变量 9 promise val; 10 11 void main() 12 { 13 auto fun1 = []() 14 { 15 //一直等待,获取全... 阅读全文
posted @ 2018-04-01 23:04 喵小喵~ 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 using namespace std; 3 4 //错误模板类 5 template 6 class error 7 { 8 T t; 9 public: 10 void showerror() 11 { 12 cout 24 class print3d 25 { 26 pu... 阅读全文
posted @ 2018-04-01 22:41 喵小喵~ 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 3 #include 4 using namespace std; 5 ////非安全退出,结束进程, 6 //C++ 必须释放对象,最后结束,安全退出 7 8 class pstr 9 { 10 int *p; 11 public: 12 pstr() 13 { 14 cout << "构造" << end... 阅读全文
posted @ 2018-04-01 20:28 喵小喵~ 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 using namespace std; 4 5 //继承自带的异常 6 class sizeerror :public exception 7 { 8 public: 9 sizeerror() :exception("尺寸大小异常") 10 { 11 12 } 13 14 const ... 阅读全文
posted @ 2018-04-01 20:16 喵小喵~ 阅读(316) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 using namespace std; 3 4 //纯虚类 5 class error 6 { 7 public: 8 //纯虚函数 9 virtual void showerror() = 0; 10 }; 11 12 class big :public error 13 { 14 public: 15 void sh... 阅读全文
posted @ 2018-04-01 12:38 喵小喵~ 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 using namespace std; 3 4 //如果产生继承,子类的对象也可以被父类捕获.因为子类内部包含父类对象 5 class outerror 6 { 7 public: 8 }; 9 10 class newerror:public outerror 11 { 12 public: 13 }; 14 15 class myclas... 阅读全文
posted @ 2018-04-01 12:14 喵小喵~ 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 异常类 1 #pragma once 2 #include <initializer_list> 3 using namespace std; 4 5 class memerror 6 { 7 }; 8 9 class outerror 10 { 11 }; 12 13 class safeinta 阅读全文
posted @ 2018-04-01 11:44 喵小喵~ 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 using namespace std; 3 4 //try尝试执行,抛出throw,throw之后语句不再执行 5 //catch处理throw的异常 6 7 void main() 8 { 9 float fl1, fl2; 10 cin >> fl1 >> fl2; 11 12 //尝试执行,抛出类型检测 13 ... 阅读全文
posted @ 2018-04-01 00:16 喵小喵~ 阅读(248) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 using namespace std; 3 4 //try尝试执行,抛出throw,throw之后语句不再执行 5 //catch处理throw的异常 6 7 void main() 8 { 9 float fl1, fl2; 10 cin >> fl1 >> fl2; 11 12 //尝试执行,抛出类型检测 13 ... 阅读全文
posted @ 2018-04-01 00:15 喵小喵~ 阅读(123) 评论(0) 推荐(0) 编辑
上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 68 下一页