Quote Originally Posted by underpressure
Since I am essentially cheating by knowing what my input file looks exactly like.
That's not cheating; that's easy mode. You should be testing with various kinds of test input: blank lines, lines in which there is no comma, or only one comma, or a dozen commas, etc.

Quote Originally Posted by underpressure
I don't see anywhere in the text file that has blank lines between my string lines that could have been causing my error.
Maybe the blank lines are at the end. Since you only seemed to have tried my advice on the code rather than my advice on debugging, who knows? I wanted you to say "blank lines are happening alternating between non-blank lines" or "blank lines are at the end", but it you don't debug, you cannot say. Even if you don't use a debugger, it could have been as simple as just commenting out the sorting part so you see the original input.

Quote Originally Posted by underpressure
Yes I am programming in Windows 10 using Dev-C++
The issue you observed can happen when you have a text file with a Windows new line sequence and try parsing it on other systems without taking the new line sequence into account. However, since you are both compiling and running on Windows, this should be a non-issue.