I am making a tic-tack-toe game, and I don't know how to make the board replace a space with an x or an o. For example, I need the board, which one row looks like this
| | | |
-------
to be able to change to this
|X| | |
-------
and be able to put the X(or O) anywhere that the space is on the line.
I have a string called board_lines that is the | | | |
and another string called board_dashes that is the -------
They make up the board by putting them all together with cout.
I'm trying to make a function where you select where you want the X to be in the column by using numbers that correspond to where it would be on the board. For example, if you wanted an X in the first column, you would say that you wanted it in position 2.