Hi guys, how are you?
I need your help in a tic tac game, I have created a program that asks a user to specify first the index whether [0][0],[2][1],[2][2],etc..and to enter the char letter either 'x' or 'o' but I don't know where is the wrong? can any any one help me
#include<stdio.h>
int main()
{
char array[3][3];
/* I want know somthinh here, in the each cell of this array does it take a charecter or a string*/
int i=0,l=0;
int x,y;
for(i=0;i<3;i++)
{
for(l=0;l<3;l++)
{
printf("Enter your index:");
scanf("%d %d",&x,&y);
printf("Enter your value inside:");
/*I want to know here why the program stops running if I used %c in scanf as below and continue looping if I used in the scanf like this ("%s",array[i][l]);*/
scanf("%c",&array[x][y]);
}
}
//here to print the vlaues of the array
for(i=0;i<3;i++)
{
for(l=0;l<3;l++)
{
printf("%c",&array[i][l]);
}
printf("\n");
}
return 0;
}