ok here is my stuck I know how to read and write a file but i cant get the same letters on my data file to match my console and i cannot load up and display the board and code. can anyone help me please.
#include <iostream>
#include <cmath>
#include <iomanip>
#include <string>
#include <ctime>
#include <cstdlib>
#include <fstream>
using namespace std;
char getMainMenu();
bool checkingChoice(char Choice);
void PlayGame();
void Displayboard();
void SaveGame();
void LoadGame();
int main()
{
string code;
char choice =' ';
//random seed code
unsigned seed =time(NULL);
srand(seed);
while (choice !='Q') //loops until user acknowlgedes correct choice
{
choice=getMainMenu(); // calls function
system("CLS"); // clears screen
switch (choice)
{
case 'P':
cout<< " Play new game"<<endl<<endl;
PlayGame(); //calls functions
Displayboard();
cout<<endl;
break;
case 'R':
cout<<" Resume current game"<<endl;
break;
case 'S':
cout<<" Save current game"<<endl;
SaveGame();
break;
case 'L':
cout<<" Load last saved game"<<endl;
break;
default:
cout << " please enter a correct choice.\n";
break;
case 'Q':
system("pause");
return 0;
}
system("pause");
}
}
char getMainMenu()
{
char choice ='P';
do
{
system("CLS");
cout << " Welcome to CodeBuster! "<<endl;
cout << "-----------------"<<endl<<endl;
cout<< " P - Play new game "<<endl;
cout<< " R - Resume current game " <<endl;
cout<< " S - Save current game " <<endl;
cout<< " L - Load last saved game" <<endl;
cout<< " Q - Quit " <<endl;
cout<< "---------------"<<endl;
if ( !checkingChoice(choice)) //checking for vaild input
cout<<"Please enter a vaild choice from above.\n";
cin>>choice;
}
while ( !checkingChoice(choice));
return toupper (choice); //toupper allows user to enter lowercase letters.
}
void Displayboard( ) // Function to initialize the gameboard.
{
cout<<" YOUR GUSSESS: "<<endl;
// create a blank board
for (int rows=0; rows<12; rows++)
{