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

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/23 21:40:39
errorC2039:''rand'':isnotamemberof''std''errorC2039:''rand'':isnotamemberof''std''errorC2039:''rand'':isnotame

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;