摘要: singleStep:比如按下键盘的左右建,每次移动的距离 pageStep:比如用鼠标对准滑动条的前面按下,每次移动的距离 value:初始默认值 接下来看该控件拥有的信号: 重点看后面的四个,看字面意思就不难理解,分别为:移动,按下,释放,改变,接下来看什么情况会触发: 首先定义了四个槽函数,看 阅读全文
posted @ 2020-08-31 21:04 sunshine_gzw 阅读(716) 评论(0) 推荐(0) 编辑
摘要: 在以下五种情况下,编译器会生成"合成默认构造函数": 1.本身没有任何构造函数,但是含有类成员,且该类成员含有默认构造函数。 2.子类继承父类,且父类含有默认构造函数,但是子类没有任何构造函数。 3.含有虚函数,且自身没有任何构造函数。 4.含有虚基类,且自身没有任何构造函数。 5.定义成员变量的时 阅读全文
posted @ 2020-08-27 15:50 sunshine_gzw 阅读(217) 评论(0) 推荐(0) 编辑
摘要: https://blog.csdn.net/qq_40286225/article/details/104089506?utm_medium=distribute.pc_relevant_bbs_down.none-task-blog-baidujs-1.nonecase&depth_1-utm_s 阅读全文
posted @ 2020-08-24 13:54 sunshine_gzw 阅读(561) 评论(0) 推荐(0) 编辑
摘要: 常规的new是分配内存,然后调用相应的构造函数,而定位new是在已经分配内存的上面调用构造函数: // ConsoleApplication7.cpp : 定义控制台应用程序的入口点。 #include "stdafx.h" #include<iostream> using namespace st 阅读全文
posted @ 2020-08-23 19:09 sunshine_gzw 阅读(137) 评论(0) 推荐(0) 编辑
摘要: // ConsoleApplication7.cpp : 定义控制台应用程序的入口点。 #include "stdafx.h" #include<iostream> using namespace std; class myallocator { public: void* allocate(siz 阅读全文
posted @ 2020-08-23 19:00 sunshine_gzw 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 下面从一个问题引入: // ConsoleApplication5.cpp : 定义控制台应用程序的入口点。 #include "stdafx.h" #include<random> #include<iostream> #include<vector> #include<thread> #incl 阅读全文
posted @ 2020-08-20 20:33 sunshine_gzw 阅读(383) 评论(0) 推荐(0) 编辑
摘要: 如果有两个线程,其中一个线程想要获取另一个线程的返回值,该怎么办? 于是接下来要谈的package_task就是为了解决这个问题而诞生的。 // ConsoleApplication5.cpp : 定义控制台应用程序的入口点。 #include "stdafx.h" #include<random> 阅读全文
posted @ 2020-08-20 18:47 sunshine_gzw 阅读(352) 评论(0) 推荐(0) 编辑
摘要: // ConsoleApplication5.cpp : 定义控制台应用程序的入口点。 #include "stdafx.h" #include<random> #include<iostream> #include<vector> #include<thread> #include<algorit 阅读全文
posted @ 2020-08-20 15:16 sunshine_gzw 阅读(559) 评论(0) 推荐(0) 编辑
摘要: // ConsoleApplication5.cpp : 定义控制台应用程序的入口点。 #include "stdafx.h" #include<random> #include<iostream> #include<vector> #include<algorithm> using namespa 阅读全文
posted @ 2020-08-20 14:02 sunshine_gzw 阅读(298) 评论(0) 推荐(0) 编辑
摘要: 首先我们要知道,计算机不能产生绝对的随机数。只能产生伪随机数。伪就是有规律的意思。伪随机数就是计算机产生的随机数是有规律的。 那么计算机是怎么产生随机数的? 当然是通过算法,这个算法是有映射关系的,如我放进1,他会出来一个特定的数 RAND_SEED=(RAND_SEED*123+59)%65536 阅读全文
posted @ 2020-08-20 12:45 sunshine_gzw 阅读(111) 评论(0) 推荐(0) 编辑