【发布时间】:2019-12-13 13:18:02
【问题描述】:
toZero = rand() % N;
这行代码给了我 Clang-Tidy:rand() 的随机性有限。为什么会出现这个警告?我该如何解决?
【问题讨论】:
-
this 有帮助吗?
-
This 还有..
-
这能回答你的问题吗? Why is the use of rand() considered bad?
-
您的代码是否会调用一次
srand(),通常是在main()函数的早期?
标签: c random warnings clang-tidy