Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int saveScores(scoreboard sBoard, const string filename) {
- ofstream outStream;
- outStream.open("/Users/Wescat/Desktop/Programming/comp2710/wsc0010_project1/scores.txt");
- if (outStream.fail()) {
- cout << "Output file opening failed." << endl;
- return 1;
- }
- int i = 0;
- while (i < sBoard.numOfScores) {
- outStream << sBoard.score->name << endl;
- outStream << sBoard.score->score << endl;
- sBoard.score = sBoard.score->next;
- i++;
- }
- outStream.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement