I have a char array that has number 0-8 in it in char form
Board[0] = '0';
Board[1] = '1';
Board[2] = '2';
Board[3] = '3';
Board[4] = '4';
Board[5] = '5';
Board[6] = '6';
Board[7] = '7';
Board[8] = '8';
and some of them are changed to either an 'x' or an 'o' based on user input however I need to figure out a way so that I can tell the total number of them that aren't an 'x' or an 'o'.
What I mean is if say 4 of the 9 are either an 'x' or an 'o' I need to be able to get the fact that there are 5 left. I was attempting to use for each(char c in Board) and I got far enough to where I got it to list the chars that aren't an 'x' or an 'o' but I can't figure out how to get it to send how many are left to an int value. This is as far as I got.
for each(char c in Board)
{
if (c != 'x' && c != 'o')
{
}
}
for each(... in ...)is not C++.forloops. If you turn in this non-standard code, and your instructor isn't using the same compiler, then you'll probably get marked down because your instructor will be unable to test it.