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

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/14 07:08:55

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

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