Again I am not sure let me know if I am wrong.
For fstream if i remember correctly you can combine the parameters with a | so it can do both reading and writing to the file?
Code:
file.open("data.txt",ios::in | ios::out);
I can get them to work sepearately just not together.
I am as puzzled as you are. I can get it to work if i only use one or the other but not both. You could define and ifstream for input and an ofstream for output that works.
Code:
ifstream file_in;
ofstream file_out;
file_in.open("data.txt",ios::in);
file_out.open("data.txt",ios::app);