Oh I see. When you first open the program read the output file into studentAvgQuiz array so that array looks just like it when when the program was shut down. Then when you write it out DO NOT open with the flags I mentioned previously -- if the file exists then you want to overwrite any exting data in it.
1. on program startup open the output file for reading and read all data into the array.
2. close the file in #1 above and reopen for output with the ios::trunc flag to delete all data in the file.
3. write the array to the file like you already posted
Last edited by Ancient Dragon; Oct 17th, 2007 at 11:24 pm.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Offline 21,954 posts
since Aug 2005