次のループで配列のi値を使用したので、何が間違っていますか?別のエラーが表示されます TicTac.c:27:15:エラー:配列型 'int [3]'を代入できません 行列[i、z] = h、v; どうもありがとうございました。私の質問を間違って尋ねると、すみませます。私の最初の質問です。どうもありがとうございます !用エラー:未使用の式結果[-Werror、-Wunused-value]行列[i、z] = h、v;わかりません?
{ /*The tic tac board*/
int Matrix[3][3] = { {6,6,6},
{6,6,6},
{6,6,6} };
/*asks user for input and gives value into the array*/
(int型のz = 0; Z < = 2; ++ z)は {
for (int i = 0; i <= 2; ++i)
{
printf("Give me your choice in the horizontal layer");
int h = GetInt();
printf("Give me your choice in the verticle layer");
int v = GetInt();
Matrix[i,z] = h,v;
/*demonstrates the board*/
for(int o = 0; o <= 2; o++)
{
for(int j = 0; j <= 2; j++)
{
printf("%d ", Matrix[o][j]);
printf("\n");
}
}
}
}
「h、v」は、あなたが思っていることをしません。それがあなたの唯一の問題であるかどうかは分かりません。 http://stackoverflow.com/questions/54142/how-does-the-comma-operator-work –
'Matrix [i、z]'と 'Matrix [o] [j]'とは何が違うのですか? 。あなたはいくつかの括弧が欠けている。 –
ありがとうございました!今それは動作します! – shesdima