Advertisement
Guest User

Untitled

a guest
May 23rd, 2015
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. void readScores(score s[10],const string scoresfile)
  2. {
  3. ifstream scores(scoresfile);
  4.  
  5. if (scores)
  6. {
  7. for (int i = 0; i < 10; i++){
  8. getline(scores, s[i].name);
  9. scores >> s[i].points >> s[i].area >> s[i].ships;
  10. }
  11. scores.close();
  12. }
  13. else cout << "ERROR: Scores file not found!" << endl;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement