fstream file(file_1.c_str(), ios::out | ios::in | ios::ate); //convert string to const char*
Error if File does not exist. if ( ! file ) = true
fstream file(file_1.c_str(), ios::out | ios::in | ios::app); //convert string to const char*
using ios::app
seekg
& seekp
functions not working. file.seekg(4, ios_base::beg);
I would like to have:
- USER input file name
- create file if NON existing
- use seekg & seekp;
- Not remove the file if you run the program again.