コードに問題があります。ユーザーがサイズ変更した動的フレームがあり、このフレーム内の 1 つのセルの位置を入力する必要があります。私の質問は、このポジションが有効であること、またはまだ入力されていないことを確認するにはどうすればよいですか?
コードは次のとおりです。
for (i = 0; i < a; i++)
{
while (x < 1 || y < 1)
{
printf("Entrez les coordonnees de la cellule %d: ", i+1); //The user gives the position of the cell
scanf("%d %d", &x, &y);
}
tab[x - 1][y - 1] = 1; //We affect 1 to the cell given by the user
}