This code runs but it is supposed to write the information to a file. I called it "corpsalesfile.txt" and created a blank project in the same folder as my program but it is not opening or writing it to the file. Anyone have any idea how to fix this?
leave out the opening of the file at line 129.
The file is already opened when constructing the fstream and calling the 'open'-function again in this case will fail and 'corrupt' the stream. Any further operation on this fstream will fail as well, so no data is written.
Another suggestion: leave out the cout at lines 130, 136, 142 and 148. You will get weird data in your file as you are writing cout (stream to standard output = console) to the file, which doesn't make sense.