当我在 vs2008 中使用 rand_r() 时,出现 1 个错误--Identifier is undefined,我可以改用 rand() 吗? (多线程编程工作。) 谢谢。
最佳答案
你必须
#include <cstdlib>
如果您出于多线程目的需要它,另请参阅 Joachim Pileborgs 的回答。
无论如何,可以使用 C++'s new RNGs 之一,您以对象的形式使用它并且具有保证的顺序。
关于c++ - rand_r() :Identifier is undefined , vs2008,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9615678/