im having major issues saving my TicTacToe game in C++.
it is mainly in the function to save the game.. im not sure also if the code is calling that function properly. il show the code.......:
{
char save_or_not;
cout<<"Would you like to save the game?"<<endl;
cin>>save_or_not;
if(save_or_not == 'y'|| save_or_not == 'Y')
{
void Save_Game();
break;
}
else
{
break;
}
.
.
.
.
.
void Game::Save_Game(char Board[3][3])
{
int i;
FILE *savegame = fopen("save.bin","w");
for (i = 0; i < 3; i++)
{
fprintf(savegame,"%c %c %c\n", Board[i][0], Board[i][1], Board[i][2]);
}
fclose(savegame);
cout<<"game saved";
}
note: Board is the array for the board.
I am a beginner at C++ so any help in relation to this program i assure you i can thank enough. So thanks in advance.