c++编译求助
#include<iostream>#include<fstream>
using namespace std;
int main()
{
ofstream fileA("fileA.txt",ios::nocreate);
if(! fileA)
{
cerr<<"Cant't open file!\n";
exit(1);
}
fileA<<"AAA1";
fileA<<"AAA2";
fileA<<"\n";
fileA.close();
}
编译显示
error C2039: 'nocreate' : is not a member of 'basic_ios<char,struct std::char_traits<char> >'C:\Program Files\Microsoft Visual Studio\MyProjects\s16\s16.cpp
(6) : error C2065: 'nocreate' : undeclared identifier
这个是什么原因啊?