int main(void)
{
ifstream playerFile;
ofstream outfile;
playerFile.open ("playerStats.txt");
bool gameOver = false; // game loop control flag
char posLocation; // user input variable for position choice
char playAgain = 'A'; // program exit control flag
char playerSymbol = 'X'; // current player symbol
char menuoption;
char nameOne;
char nameTwo;
string pos1, pos2, pos3, pos4, pos5, pos6, pos7, pos8, pos9; // board display variables
DisplayIntro(); // Display introduction screen
DisplayMenu(); //Display Menu screen*
cin >> menuoption;
menuoption = toupper(menuoption); //convert to uppercase
enum Menu {PLAY, DISPLAY, SAVE, SORT, EXIT};
if (menuoption = PLAY)
{
AskForName(nameOne, nameTwo);
AskForSymbol(playerSymbol);
}
if (menuoption = DISPLAY);
{
displayStats ();
}
if (menuoption = SAVE);
}
saveStats()
{
if (menuoption = SORT);
{
selectionsSortData();
}
if (menuoption = EXIT)
DisplayCredits(); // Display the credit screen
playerFile.close();
outfile.close();
return 0;
}
void displayStats (ofstream& outfile, (ifstream& playerFile player[index]), int listsize, char name, int wins, int loss, int ties, int total);
{
struct playerFile
{
char name;
int wins;
int loss;
int ties;
int total;