Hi I am trying read in a file and sort it with user number SSN number, but I have no idea how to do it. I also need to separate the first name and last name with the comma. Another problem tends to show up when I compile the program. There is an extra line between age and the address, and it only occurs to the first person's information. Any help will be appreciated.
Better put ther required variables into a struct or class
There is an extra line between age and the address
This proble occurs due to the fact that the operator>> leaves and end of line in the stream. getline() takes it as an empty line.
line 31: are you sure you want to read the address until the end of file?
line 23: there might be other errors. So better use something like while(theFile.good())