Writing to files

I just learned how to write to a file, but when I do this, it completely erases the file and writes what you want. Is there any way of writing something to a text file, closing it, and then adding some more to it without erasing what was already in it?
Try using:
 
streamname.open ("filename.txt", fstream::in | fstream::app);  //fstream::app means "append" 
Topic archived. No new replies allowed.