上一页 1 ··· 31 32 33 34 35 36 37 38 39 ··· 68 下一页
摘要: 1 #define _CRT_SECURE_NO_WARNINGS 2 #include 3 #include 4 #include 5 using namespace std; 6 7 class fun 8 { 9 public: 10 char str[100]; 11 public: 12 fun(char *str) 13 { 14 ... 阅读全文
posted @ 2018-03-12 10:47 喵小喵~ 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 using namespace std; 4 5 //伪函数,可以将对象名当做函数来使用 6 struct func 7 { 8 func() 9 { 10 cout << "create "<< endl; 11 } 12 ~func() 13 { 14 ... 阅读全文
posted @ 2018-03-12 10:40 喵小喵~ 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 6 //声明类 7 class myclass; 8 9 struct info 10 { 11 myclass *p;//指针,内存首地址 12 int n;//代表有多少个对象 13 }; 14 15 ... 阅读全文
posted @ 2018-03-12 10:33 喵小喵~ 阅读(244) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 using namespace std; 4 5 //全局内存管理,统计释放内存,分配内存 6 7 //重载全局的new 8 void *operator new(size_t size) 9 { 10 cout << "g_new call" << endl; 11 void *p = malloc(si... 阅读全文
posted @ 2018-03-11 23:01 喵小喵~ 阅读(232) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 8 void main() 9 { 10 //获取线程id 11 thread th1([]() { 12 //等待 13 this_thread::sleep_for(chro... 阅读全文
posted @ 2018-03-11 21:40 喵小喵~ 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 //全局变量会造成冲突,使得结果不正确 8 //mutex结果正确,速度慢 9 //atomic 结果正确,速度快 10 11 12 //线程安全,多线程访问不冲突 13 //int num = 0; 14 15 //原子... 阅读全文
posted @ 2018-03-11 21:33 喵小喵~ 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 void show() 8 { 9 MessageBoxA(0, "1", "1", 0); 10 } 11 12 void main() 13 { 14 //获取CPU核心的个数 15 auto n ... 阅读全文
posted @ 2018-03-11 21:22 喵小喵~ 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 6 void run() 7 { 8 MessageBoxA(0, "0", "0", 0); 9 } 10 11 void showmsg(const char *str1,const char *str2) 12 { 13 Messa... 阅读全文
posted @ 2018-03-11 21:11 喵小喵~ 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 using namespace std; 4 5 struct info 6 { 7 int id; 8 int num; 9 //堆上面开辟内存必须有构造函数 10 info(int nid, int nnum) :id(nid), num(nnum)//构造函数 11 { 12 ... 阅读全文
posted @ 2018-03-11 21:01 喵小喵~ 阅读(237) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 using namespace std; 4 5 //指行system指令 6 void gocmd(const char *cmd) 7 { 8 system(cmd); 9 } 10 11 //输出cmd指令 12 void showcmd(const char *cmd) 13 { 14 cout <... 阅读全文
posted @ 2018-03-11 20:42 喵小喵~ 阅读(125) 评论(0) 推荐(0) 编辑
上一页 1 ··· 31 32 33 34 35 36 37 38 39 ··· 68 下一页