Created
December 6, 2018 17:06
-
-
Save Devhobby/f5077cde0414c1f674f7b64d95546fb5 to your computer and use it in GitHub Desktop.
scoreboard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ScoreBoard::ScoreBoard() : filestatus(true) { | |
std::ifstream scoreFile("score.dat"); | |
if (!scoreFile.is_open()) { | |
filestatus = false; | |
for (auto &i : score) | |
i = 0; | |
} else { | |
for (auto &i : score) | |
scoreFile >> i; | |
std::sort(score, score + 10, std::greater<>()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment