Commit 523a5e90 authored by Kyle Malaguit's avatar Kyle Malaguit

autosave

parent 6317fec5
......@@ -25,8 +25,8 @@ void SaveLoad::displayScores(){
void SaveLoad::userInputNameMakeScore(int intScore){
char userNameInput[3];
cout << "Please enter a 3 character user name\n";
do{
cout << "Please enter a 3 character user name\n";
try{
cin >> userNameInput;
if(strlen(userNameInput) != 3){
......@@ -41,10 +41,7 @@ void SaveLoad::userInputNameMakeScore(int intScore){
}while(true);
Scores*scorePtr = nullptr;
scorePtr = new Scores(userNameInput, intScore);
pushBackNewScoreAndSort(*scorePtr);
delete scorePtr;
pushBackNewScoreAndSort(Scores(userNameInput, intScore));
}
\ No newline at end of file
......@@ -29,7 +29,7 @@ int main(){
// second.displayScores();
second.userInputNameMakeScore(1000);
second.userInputNameMakeScore(9999);
second.updateFile();
second.displayScores();
......
......@@ -2,10 +2,15 @@ NAME SCORE
nge 654346
vfd 45365
cdn 21474
bbb 9999
vfr 9999
ddd 9999
Kyl 9999
vfd 4636
vev 4536
DVS 3423
goo 1000
vfd 1000
efd 1000
dew 343
bth 34
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment