Outputting Issue Help Please

Hi Everyone,

I am a new programmer and following a YouTube channel for C++ intro (The New Boston). I am having the following issue with my program:

My program is only outputting the last line instead of outputting all the line. Can someone please explain what's wrong with my logic...

#include <iostream>
#include <string>
#include <fstream>

using namespace std;

int main()
{
ifstream bucky("players.txt");

int id;
string name1;
string name2;
double money;

// 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

My Output:

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.
@jib --- Thank you so much!
Topic archived. No new replies allowed.