I'm having some problems with a file stream. I Would be glad if somebody would help me
void SaveCharacter()
{
freopen("SaveGame.txt","w",stdout);
printf("%s\n",PlayerName);
printf("%d",PlayerExp);
//fclose(stdout);
}
void LoadCharacter()
{
freopen("SaveGame.txt","r",stdin);
scanf("%s\n",PlayerName);
scanf("%d",&PlayerExp);
//fclose(stdin);
I'm trying to use these 2 voids but it gets stuck when not using fclose and it gives a "handle is invalid" error when i use fclose. What could be the problem?






