I have been writing a flash card program and have just got to saving and loading data. The program currently takes data from a file a puts it into the program but when I run the saveFile function it saves with two extra blank lines at the end. After the last piece of data there has to be nothing or else my loadFile function will think it's another card.
Through a quick read of your code, it seems like those last two lines are because of the "<< endl;"s you have on line 11. If you still want those in the upper cards but not after the last card, put the endl's before you write the data.