I have a code like
if (config_atual[6]==config_atual[7]==config_atual[8] ||
config_atual[1]==config_atual[4]==config_atual[7] ||
config_atual[2]==config_atual[4]==config_atual[6])
{
if (config_atual[7]=='X')
cout << "O Jogador ganhou!" << endl;
else if (config_atual[7]=='O')
cout << "O Computador ganhou!" << endl;
}
about a tic-tac-toe game, and whenever I try to compile this line of code, which verifies three of the win conditions (assuming indexes 0,1,2 for first line, 3,4,5 for second and 6,7,8 for last) I get this warning :
suggest parentheses around comparison in operand of '==' [-Wparentheses]
Which I don't understand. What I am doing wrong, config_atual
is a char array that contains the present configuration of the playing board.
What does this warning mean, and how can I correct it?