I have this program that writes to a file to keep a track record, however, each time I open the file, the value that was in the file before is replaced by a new file.
use the fstream with the ios::app parameter. This way it will take the stuff you want to put in the file and add it to the end of the file. Hope that helps.