I've got a simple program which is supposed to take in an input file which contains a first and last name and then various integers afterwards. I'd like to be able to write the first two strings for the names into their own variables, and the rest of the integers into their own array. I have code setup already, with the strings read into their own variables, however when I attempt to write the integers into their own array, I get an infinite loop of the first two strings alternating forever. Here is the code.
int main()
{
std::string first_name,last_name;
int scores_tem[20];
int i=0;
std::ifstream filen ("input.txt");
if (filen.is_open())
{
while(!filen.eof())
{
filen >> first_name >> last_name;
for(i;i<20;i++)
{
filen>>scores_tem[i];
}
}
}
}