error C2039:'rand' :is not a member of 'std'

来源:学生作业帮助网 编辑:作业帮 时间:2024/06/04 05:18:22

error C2039:'rand' :is not a member of 'std'

rand和srand及time没有加入名称空间std中,而是全局的.
下面这些代码是错误的,如果你是这么写的,去掉吧.
using std::rand;
using std::srand;
using std::time;