// now we will use the while loop which will Loop through and instore the value of desired variable to it's own
while (bucky>>id>>name1>>name2>>money) ;
{
cout<<id<<", "<<name1<<", "<<name2<<", "<<money<<" . "<<endl;
}
}
My Text File:
1 Payton Manning 22
2 Cristiano Ronaldo 34
3 Lebron James 56
4 Novack Djokovic 34
5 Sakib Alhasssan 78
Look for extra semicolons at the end of your control statements. These extra semicolons tell the compiler that the control statement (while()) has no body.