error C2039: 'set' : is not a member of 'std' 是因为什么?

来源:百度知道 编辑:UC知道 时间:2024/05/23 18:02:48
error C2039: 'set' : is not a member of 'std'
程序出现了这个错误,是因为什么呢?
谢谢~

//你应该使用如下
#include <set>
using std::set;
int main()
{
set<int> s;
return 1;
}

按你提供的错误显示
set不是命名空间为std的成员呀
要么发代码上来

C++命名空间用两冒号分离
std::set 不是std.set

using namespace std;