请问此问题为什么无法编译?
#include<fstream>#include<iostream>
using namespace std;
int main()
{
ifstream infile("f1.dat",ios::in|ios::noreplace);
if(!infile)
{
cerr<<"open error.\n";
exit (1);
}
cerr<<"计算机\n";
return 0;
}
编译结果:
--------------------Configuration: w - Win32 Debug--------------------
Compiling...
1.cpp
E:\程序A\w\1.cpp(6) : error C2039: 'noreplace' : is not a member of 'basic_ios<char,struct std::char_traits<char> >'
E:\程序A\w\1.cpp(6) : error C2065: 'noreplace' : undeclared identifier
Error executing cl.exe.
1.obj - 2 error(s), 0 warning(s)