Stuck in an infinite loop
I'm learning about filestreams and I used the example given in the tutorials.
the problem is I get stuck in an infinite loop in my while statement.
1 2 3 4 5 6 7 8 9 10 11 12
|
ifstream nFile("names.txt");
if(nFile.is_open())
{
while(! nFile.eof() );
{
getline(nFile,name[num]);
num++;
}
nFile.close();
}
|
How do I escape the loop?
You should not put a ; after while.
ZOMg, I'm so Blind XD. Thank you.
Topic archived. No new replies allowed.