0

char square[10]={'1','2','3,'4','5','6','7','8','9'}; int choice; printf ("input choice "); if(square[choice]==choice){...}

1st May 2021, 6:21 AM
Buma Emmanuel
Buma Emmanuel - avatar
5 Answers
+ 1
Buma Emmanuel Which Problem it is? Please mention language and task from where did you find it
1st May 2021, 6:29 AM
A͢J
A͢J - avatar
0
Buma Emmanuel What you want to ask?
1st May 2021, 6:22 AM
A͢J
A͢J - avatar
0
That does work but this does,for example If(choice==1&&square[1]=='1'){…}
1st May 2021, 6:25 AM
Buma Emmanuel
Buma Emmanuel - avatar
0
*the code in question does not work but what i just sent works
1st May 2021, 6:27 AM
Buma Emmanuel
Buma Emmanuel - avatar
0
Im creating tictactoe game in c language,it works when i give cases for when choice equals any of the squares from 1 to 9,but i wanted to compress all that to just one if statement instead of nine that is why i tried that method above but it doesnt work , so im just asking to know why
1st May 2021, 6:39 AM
Buma Emmanuel
Buma Emmanuel - avatar