Error:expression must be a modifiable Ivalue

Oct 4, 2010 at 5:41pm
Hello i'm new to c++ and i'm following the xoax.net c++ tutorials and now i'm trying to complete the tic tac toe game.
But i get this error : Error:expression must be a modifiable Ivalue
What does that mean and how can i fix it?
The error is in cSquare1 != '1'
1
2
3
4
5
6
if (cSquare1 != '1' && cSquare2 != '2' && cSquare3 != '3' &&
	cSquare4 != '4' && cSquare5 != '5' && cSquare6 != '6' &&
	cSquare7 != '7' && cSquare8 != '8' && cSquare9 != '9' && bGameOver = false)
{
	bGameOver = true;
}


If you need to see the rest of the code just tell me.
Oct 4, 2010 at 5:55pm
There's nothing wrong with the code you posted.
It would be good to see at least the declaration of cSquare1.
Oct 4, 2010 at 5:55pm
FYI, the I is actually an L.

bGameOver = false this is assignment, not comparision, use == for that.

But yeah, what is cSquare1?
Last edited on Oct 4, 2010 at 5:57pm
Oct 4, 2010 at 5:59pm
well cSquare1 is
number 1 on the field and is changed to X or O's
char cSquare1('1');
Last edited on Oct 4, 2010 at 6:12pm
Oct 10, 2010 at 6:58am
Thanks i used == and it works now thanks :D
Topic archived. No new replies allowed.