I am working on a simple tic tac toe game. I have written code that prints out a menu, asks the players to start the game, prints a playing board, and allows the players to enter X's and O's. When a player enters three X's the game does not stop and asks the next player to enter a character. I have a function that is supposed to check to see if a player has won the game, but that function is not working. I have looked into the archives but have not been able to apply any of the other posts to my problem. Below is the code with a few descriptions of whats going on within it. I am using CodeBlocks and am on a Windows device. Thank you in advance.
//***** compiler directives and function/variable declarations ***** //
#include <iostream>
using namespace std;
char square[10] = {'o','1','2','3','4','5','6','7','8','9'};
int menuChoice;
int winCheck();
int a=winCheck();
int player=1,i,choice;
void board();
//***** Main function *****//
int main(){
//***** menu printout *****//
cout << "welcome to tic tac toe\n" << endl;
cout << "player one is X's and player two is O's" << endl;
cout << "enter 1 to play and 2 to exit" << endl;
int menuChoice;
cin >> menuChoice;
if (menuChoice == 1){
int player = 1,i,choice;
int a=winCheck();
//***** Do/while statement for the input of choices while playing *****//
do{
board();
player=(player%2)?1:2;
cout << "player " << player << "pick a number " << endl;
int choice;
cin >> choice;
char mark=(player == 1) ? 'X' : 'O';