Advertisement
Guest User

Untitled

a guest
Apr 21st, 2014
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. int saveScores(scoreboard sBoard, const string filename) {
  2. ofstream outStream;
  3. outStream.open("/Users/Wescat/Desktop/Programming/comp2710/wsc0010_project1/scores.txt");
  4. if (outStream.fail()) {
  5. cout << "Output file opening failed." << endl;
  6. return 1;
  7. }
  8. int i = 0;
  9. while (i < sBoard.numOfScores) {
  10. outStream << sBoard.score->name << endl;
  11. outStream << sBoard.score->score << endl;
  12.  
  13. sBoard.score = sBoard.score->next;
  14. i++;
  15. }
  16. outStream.close();
  17. return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement