True enough,about certain char being translated in the text mode.But let me remind that file<<"abc123" is a string.Try doing file<<"abc"<<123<<(char)123;
See what happens, one forgets and assumes a bit somethimes.
If you open an ofstream object with a file name, and write output to it, then call open() on the same file stream without closing it, there will be no errors. The call to open() will close the file you were writing to and just open another file. Similarly:
Try doing that with the fstream object.Also if an fstream object is declared in the global scope and it's not closed when you run the program again some access errors might be shown. A lot of my friends had this problem when they did their projects.Never declare anything global unless it's necessary.
This may not be true on diffrent compilers (or even the same one's diffrent versions).That could have happened due to a lot of reasons.But it a good practice to alway close a file handle before you exit .I just said something which might possibly happen, :).
I love the fstreams too.Thanks so much Jubulani.