Why does my loop loops 3 times when i have only 2 line of data in my file? From the cout << s.size , when i run it will show 1,2,3.
Information in txt file
outputCode:local john 10/2/1990
international tom 2/5/2000
Code:local john 10/2/1990
international tom 2/5/2000
international tom 2/5/2000
Code:ifstream in(filename);
while()
{
if (in.eof())
break;
if(in)
{
in >> nationality;
in >> name;
in >> DOB;
clsStudent student(nationality, name, DOB);
s.push_back(student);
}
else
cerr << "\nCannot open " << filename << " for reading" << endl;
cout << s.size();
}