Code:
   while (!inFileEvening.eof() )
   { 
      // store data from file to variables
      inFileEvening >> studenteveningId >> firstname >> surname >> num1 >> num2 >> num3 >> num4 >> num5;
      

      // formatting for name    
      studentname = surname + ", " + firstname;
      while(studentname.length() != 20)
      {
         studentname = studentname + " ";
      }
Im using that, i have that loop twice in my code, and when it outputs to reports_regular.txt , it displays the last student twice for some reason, so if my studentsDay.txt and studentsEvening.txt have 30 students listed altogether, the number of students shown will be 32, because the last person is added again on each output files.

I've read over the forums about while (!inFileEvening.eof() ) not working properly with reading lines?? i have no idea, please help
thanks