tic tac toe code in c++ with two players
You can address both of the your problems using &quot;struct&quot;.
By making something like this:
struct myBorad 
{
    char board[3][3] = { {'1', '2', '3'}, {'4', '5', '6'}, {'7', '8', '9'} };
    bool bMyBoardStatus[9] = { false };
};
myBorad g_myBoard;

You then need to change each of the fields as &quot;taken&quot; by setting them to &quot;true&quot;.
after each player play.
g_myBoard.bMyBoardStatus[0] = true;

Now that you have this in place you can add two ifs:

Check if the status of selected by player place is &quot;taken&quot; aka not false.
Check if all the array aka all nine of them are true and you didn't meet the win condition yet that means its draw.

there are more elegant solutions but this will help you get what you need, and this does not have to be in struct. i prefer this way.