fstream的用法问题!
#include <fstream>
#include <iostream>
using namespace std;
int main()
{
ifstream inifile;
inifile.open("e:/123.txt");
if(!inifile)
{
cerr<<"file is not open"<<endl;
return -1;
}
while(inifile>>"hello")
cout<<"ok"<<endl;
inifile.close();
inifile.clear();
return 0;
}
为什么会在执行时提示;Text256.exe 遇到问题需要关闭。我们对此引起的不便表示抱歉。