View Single Post
Join Date: May 2004
Posts: 256
Reputation: FireNet will become famous soon enough FireNet will become famous soon enough 
Solved Threads: 6
FireNet's Avatar
FireNet FireNet is offline Offline
Posting Whiz in Training

Re: fstream Tutorial

 
0
  #5
Aug 21st, 2004
Quite simple really,just open word.txt with ios::app (append) added to the options when opening the file.That will automaticaly put the file pointer to the end of the file and you can just write to it normally.

Another way is to open the file and use filehandle.seekp(0,ios::end); to move the pointer to the end of the file and then write the output you want to the file and it will still be at the end.

Checks the tut for the list of options,I covered them there.

Btw,then close the file when you exit or are finished with using it.There you go a new word was added to the file.
See what you can, remember what you need

Fourzon | Earn via Coding
Reply With Quote