设置随机数的初值有关问题

设置随机数的初值问题在构造函数中添加:qsrand(time(0))运行时提示“: error: time was not declared in

设置随机数的初值问题
在构造函数中添加:qsrand(time(0));

运行时提示“: error: 'time' was not declared in this scope”

[解决办法]
lz 试下这个 函数

C/C++ code
qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));
[解决办法]
lz 对啦 加分噢