I am having a question about how to create a function where I will use the values of an array of int main, and then how to override the values obtained in the array of the function for the array of int main?
I was creating the function like this:
int JogadaComp2 (int tabuleiro[3][3])
{
if ( tabuleiro [2][2] = 0) { tabuleiro[2][2] = 1;return 0;}
if ( tabuleiro [1][1] == 2 && tabuleiro [1][2] == 2 && tabuleiro [1][3] ==
0) { tabuleiro[1][3] = 1;return 0;}
if ( tabuleiro [1][1] == 2 && tabuleiro [2][1] == 2 && tabuleiro [3][1] ==
0) { tabuleiro[3][1] = 1;return 0;}
return tabuleiro[3][3];
}
and to replace the values in the array of int main:
int main (){
int tabuleiro[3][3];
tabuleiro[3][3] = JogadaComp2(tabuleiro[3][3]);
for(l=0;l<3;l++)
{
for(c=0;c<3;c++)
{
printf("%d", tabuleiro[l][c];
}
printf("\n";
}
return 0;
}