Hi,
If I use the fstream i/o lib, how do I scan for file errors? In particular when a file does not exist. I have looked everywhere in the MS VC++ help and cannot find a method.
fstream f,mat;
f.open("list.txt",ios::in);
//MessageBox(hdwnd,result,"",MB_OK);
if(ios::fail!=0)MessageBox(hdwnd,"W","e",MB_OK);
while (!f.eof())
{
f.getline(part[x],15,''\t'');
f.getline(description[x],50,''\n'');
x++;
}
ListLoad=true;
f.close();
My code is as above.
Thanks
Indy
Indy
Isn''t that it right there? Won''t the condition ios::fail != 0 fail if the file doesn''t exist?
Anyway, won''t this do the trick?
Anyway, won''t this do the trick?
|
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement