Is there a reason why I can't reach my extraction for the istringstream stuff? It keeps looping before it even reaches the line : stuff >> year >> name >> percent >> sex;.. Think it has something to do with getline?
I am not sure if this is the problem, but think about your code for a second. Suppose input has 1 line.
In your loop, you use getline to read that 1 line in input. The eof flag has not been set, because there is no way for the program to know that your file only had 1 line.
So after the loop, you test the loop condition again and it evaluates as true. This time, when you use getline, there is an error because there is no more lines to read in input. Now is when the eof flag is set.
However, the program is still trying to execute all the other commands in the loop, even though getline didn't actually get anything.