Hi. I'm new here and I have a problem on my program. I want to display the scores on notepad. I can display it but the problem is every time I play the game the previous score got erased and replaced by the new one. Thanks in advance :))
Here's my code.
cout<<" Enter your name: ";
cin>>a;
cout<<endl<<endl;
cout<<" Your name is "<<a<<" and your score is "<<right<<endl<<endl;
ofstream MyFile ("score.txt");
MyFile << a <<" "<<right;
MyFile.close ();