Hi, im trying to finish up my assignment on tic tac toe game.. and my program keeps crashing, here are two functions where i think it crashes, probably the first one:
void tic_tac_toe_init (char *ttt[3][3])
{
char i,j;
int k=' ';
for (i=0;i<3;i++)
{
for (j=0; j<3; j++)
{
*ttt[i][j]=(char)k;
printf ("%c\n", *ttt[i][j]);
}
}
}
is_tic_tac_toe_full (char *ttt[3][3])
{
int i, j, k=0;
for (i=0;i<3;i++)
{
for (j=0; j<3; j++)
{
if ((int)*ttt[i][j]==' ')
{
k++;
}
}
}
if (k>=1)
{
return 1;
}
else
{
return 0;
}
}
and also a second question for another program: When i initialize the array for example a[2][2] and i want to fill it like this:
char a[2][2]={{' ', 1, "11-12PM"},
{'A', 1,2},
{"sad", 3,4}} and so on
for some reason it gives me errors
thanks in advance