> I cannot get a program to write to a file using ios::ate
> as i need to insert spaces into an existing file.
> Does anyone have any suggestions.
> void main()
> ofstream fout( "testfile.txt", ios::ate);
> int t1=1;
> int t2=2;
> fout << t1 << ' ' << t2;
Second, the use of the words "insert" seems at odds with ios::ate.
Ate means seek to the end after opening (that is, append to the end of
this existing file). I believe it "ATE" is dervied from "AT END."
The "app" for "append" mode means seek to the end prior to each write
(similar to the same mode in stdio).