I have a 9-element char vector that gets initialized to spaces when the program runs. During the course of the program, I want to input a number and have it change that number element in the array to something else ('X' in my case). Thing is, I input the number in a different function and I can't figure out how to transfer the change between the two functions.
I'm pretty sure I need to send both an int (for the vector element number) and a char (for the actual change in value), but nothing I've tried has worked.
I might not even be making any sense, I've been working on this for hours now and my mind is starting to melt. If I can clear any confusion, I'd be glad to help.
//human's turn to act, might not be important
int humanTurn()
{
int choice;
gameBoard();
cout << "\nChoose where to put your X: ";
cin >> choice;
checkValidH(choice);
return 0;
}
Won't that just make a copy of the vector and not affect the original? I have to call all of the elements of the vector to my gameBoard() function, so I think I need the original to be changed.
I did not see that, and I feel stupid for it. So, would I edit my current charLib() function, or create a whole new one with what you posted? I really appreciate the help, by the way. :)