【发布时间】:2013-11-23 18:38:22
【问题描述】:
这是我遇到的错误
mouse_cat.c:20: error: array type has incomplete element type
mouse_cat.c:20: error: expected ‘;’, ‘,’ or ‘)’ before numeric constant
mouse_cat.c:27: error: array type has incomplete element type
mouse_cat.c:27: error: expected ‘;’, ‘,’ or ‘)’ before numeric constant
这是源代码
void enlever(char terrain [ ][ ],int x,int y)
{
terrain[y][x]=' ';
}
//********************************************//
void ajouter(char terrain [ ][ ],int x ,int y,int flag)
{
if(flag)
terrain[y][x]='C';
else
terrain[y][x]='S';
}
这是我的宣言
#define x 23
#define y 22
char terrain [y][x];
我使用 Gcc (linux)
【问题讨论】:
-
也许与 if(flag) { terrain[y][x]='C'; } else { 地形[y][x]='S';}
-
#define x 23 会造成很大的麻烦。任何你有 x 的地方,编译器都会把 23..
-
那我该怎么办? !!!!!!!!!!!!!!!!!!