B
Bernhard Hidding
Hello,
my program writes an array into a file using the following code:
ofstream arrayfile;
arrayfile.open("array_file.dat");
....
arraydatei.close();
This works as long as the file does not exist before I run the program. If
the file already exists the program does not overwrite it with new data, but
does nothing. I am using g++ on SuSE 9.1. It seems that the default on my
system is NOT to overwrite an existing file. How do I specifiy that an
existing file should be overwritten? Probably by using the ios_base:: flag
in a proper way?
Thanks in advance,
Bernhard Hidding
my program writes an array into a file using the following code:
ofstream arrayfile;
arrayfile.open("array_file.dat");
....
arraydatei.close();
This works as long as the file does not exist before I run the program. If
the file already exists the program does not overwrite it with new data, but
does nothing. I am using g++ on SuSE 9.1. It seems that the default on my
system is NOT to overwrite an existing file. How do I specifiy that an
existing file should be overwritten? Probably by using the ios_base:: flag
in a proper way?
Thanks in advance,
Bernhard Hidding