bool validatePosition (char pos, char mt [l][c], bool player1)
// converts numerical character to number, in range -1/8 instead of 0/9
int position = pos - '0' - 1;
if(position == -1)
position = 0; // quick fix -- should be done better
int row = position / COLUMN_COUNT;
int col = position % COLUMN_COUNT;
if (mt [row][col] != '?')
cout << "Position already used, type another position." << endl;
if (player1 == true)
mt [row][col] = 'X';
mt [row][col] = 'O';
but it would be better to use directly an integer to input the position.
I'd use more descriptive names: gameType == SINGLEPLAYER // MULTIPLAYER // SINGLEPLAYER_HARD instead of op == 1// 2 // 3 .
And it doesn't look like you can have op == 3.
I just skimmed through it, but since there isn't much of an explanation of what you're doing I see it more like a code sample, and in this case I would polish it some more rather than use clear and simple logic to help beginners. But that's just me.