请教出错在哪里?
#include <iostream>#include <fstream>
using namespace std;
int main()
{
int a[10],max,i,order;
ifstream infile("f1.dat",ios::in|ios::nocreate);
if(!infile)
{
cerr <<"open error!"<<endl;
exit(1);
}
for(i=0;i<10;i++)
{
infile >>a[i];
cout <<a[i]<<" ";
}
cout <<endl;
max=a[0];
order=0;
for(i=1;i<10;i++)
{
if(a[i]>max)
{
max=a[i];
order=i;
}
}
cout <<"max="<<max<<endl<<"order="<<order<<endl;
infile.close();
return 0;
}
出错信息:
--------------------Configuration: 131 - Win32 Debug--------------------
Compiling...
131.cpp
E:\Program Files\Visual.C++.6.0\VC6_green\VC6\MyProjects\13\131\131.cpp(7) : error C2039: 'nocreate' : is not a member of 'basic_ios<char,struct std::char_traits<char> >'
E:\Program Files\Visual.C++.6.0\VC6_green\VC6\MyProjects\13\131\131.cpp(7) : error C2065: 'nocreate' : undeclared identifier
执行 cl.exe 时出错.
131.exe - 1 error(s), 0 warning(s)
我用的是VC6
请教下是出错在哪里了,谢谢