It's been a while since I've written any C++ but I know you can loop in a manner similar to this:
Code:#include<conio> #include<iostream> #include<iomanip> #include<fstream> #include<dos> using namespace std; int main() { int score; char user_name[25]; char user_score[3]; ifstream infile; infile.open("NAME_QUIZ.DAT", ios::in); while(infile) { infile.get(user_name,25); infile.ignore(80,'\n'); infile.get(user_score, 3); infile.ignore(80, '\n'); score = atoi(user_score); cout << user_name << endl; cout << user_score << endl; getch(); } infile.close(); return 0; }







Reply With Quote