So I have a vector that I want to modify, and a function that should do so. But when I output the values of the vector after calling the function, nothing has changed.
Here is my vector:
vector<char> board = {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '};
And here is my function:
void take_turn(vector<char> board) {
int input;
cin >> input;
board[input] = 'x';
}
Let's say the input is 1. Here is what I was expecting:
, x, , , , , , , ,
Here is what I get:
, , , , , , , , ,