Hi, i have created a game in c++ and i want some way of saving a highscore to a file and loading it when the game starts
all i want to do is, when the game first starts and there is no file called highscore.txt, save a 0. if it is there then just load the highscore thats in there
if (n < score){
if(highscore < score ){
if(end==true){
fprintf (FPtr, "%d" , score);//print the score to file if it is higher than the score already there
rewind(FPtr);//rewind the file, so pointer starts at begining
fscanf(FPtr,"%d",&highscore);//scan file for int
}
}
}