Hi there, I'm having a problem re-opening files of type ifstream that I closed. for example...
1 2 3 4
|
ifstream file_in;
file_in.open("data.dat");
file_in.close("data.dat");
file_in.open("data.dat");
|
After this, the file does not open correctly - file_in.fail() returns true every time. Am I doing anything wrong?
I'm using the g++ compiler.
Last edited on
I just found that on google.. I was just about to post it but oh well. But thank you, that fixed the problem. What does ifstream.clear() do anyways?
resets it. anything you did before .clear has no effect; it's like recalling it.