当前位置:网站首页>Qt5.15中qsrand,srand随机数生成函数已弃用问题
Qt5.15中qsrand,srand随机数生成函数已弃用问题
2022-06-28 22:05:00 【新潮技术研究社】
我们经常会碰到诸如产生随机数的问题,以往使用的习惯的srand,qsrand等函数已经在Qt5的最后末代版本Qt5.15中被弃用了,到了Qt6就更加不会再使用它了,取而代之的是QRandomGenerator类。
int x = 0, y = 0;
srand(time(NULL));
x = rand()%N;
y = rand()%N;x = QRandomGenerator::global()->generate()%N;
y = QRandomGenerator::global()->generate()%N;
边栏推荐
- 杆会睡不着觉
- 职业问诊 | 在数据分析面试中,这样做自我介绍才靠谱
- [golang] leetcode intermediate subset & Word Search
- Description détaillée du schéma technique du sous - environnement syntonique auto - test de Zadig pour les développeurs
- Ctrip will push the "3+2" working mode: 3 days a week on duty and 2 days of free choice of office space. Do you envy it?
- 爱数SMART 2022峰会开启,分享数据战略与建设数据驱动型组织方法论
- 宜明昂科在港交所递表:2021年亏损翻倍,过往融资额存在夸大情形
- There is no picture problem when using tcpdf to generate pdf
- 职场进阶 | 了解岗位优势三板斧之“进场”
- Zadig 面向開發者的自測聯調子環境技術方案詳解
猜你喜欢

What is low code development?

The technology giants set up the meta universe standard forum to open up or build a besieged city?

小样本利器2.文本对抗+半监督 FGSM & VAT & FGM代码实现

Safety innovation practice | Haitai Fangyuan was invited to participate in the technical exchange Seminar on "network information innovation and value co creation in the digital age"

PE file-

Zadig officially launched vs code plug-in, making local development more efficient

数据可视化中柱状图的实例应用,让乘风破浪公演结果一目了然

Yiming Anke submitted a statement to the Hong Kong Stock Exchange: the loss doubled in 2021, and the past financing amount was exaggerated

華為雲的AI深潜之旅
![Sword finger offer:[day 1 stack and queue (simple)] --- > use two stacks to realize the queue](/img/e4/60b063a3131d92e40b5fa610bbec17.jpg)
Sword finger offer:[day 1 stack and queue (simple)] --- > use two stacks to realize the queue
随机推荐
给朋友的忠告
C#/VB.NET 将PDF转为Excel
【HackTheBox】dancing(SMB)
Pat 1024 palindromic number (25 points) sum of large integers
F1tenth gym of ROS 2 humble hawksbill
ansible生产环境使用场景(七):批量部署elk客户端
Use of axurer9 master
VR全景制作的前景如何?
Introduction to wrk pressure test tool
终于有人把云原生架构讲明白了
硬件开发笔记(七): 硬件开发基本流程,制作一个USB转RS232的模块(六):创建0603封装并关联原理图元器件
Water brother's code
常用工具类与commons 类库
How to make beautiful pictures
Adding a markdown editor to lavel
小样本利器2.文本对抗+半监督 FGSM & VAT & FGM代码实现
Use of axurer9 option group
Progress in visual weakly supervised learning
数据库基础笔记
现在还能入“坑”数据分析吗?看看2022年数据分析热门岗位!