in what position is a file opened?
I do this
The result is "FRACK!" the second time I run this code (it is done in a while loop)
// write to bar, works fine
system("command to change bar to foo");
cout<<"ERROR: couldn't open foo for reading"<<endl;
Why? Shouldn't the file be opened in the beginning? The file "foo" is changed before each run, but that shouldn't matter, should it?