error C2065 未声明的标识符。 已经引入头文件为什么还是未声明?
#include "LinkedStack.h"
#define status int
#define pane_height 51
#define pane_width 51
int maze[pane_width][pane_height]={0};
void AddwallList(Node *head, int x, int y){
if(x>1){
if(maze[x-2,y]!=0){
Push(head, x-1, y);
}
}
if(x<pane_width-2){
if(maze[x+2,y]!=0){
Push(head, x+1, y);
}
}
if(y>1){
if(maze[x,y-2]!=0){
Push(head, x, y-1);
}
}
if(y<pane_width-2){
if(maze[x,y+2]!=0){
Push(head, x, y+1);
}
}
}
status theMaze(){
int a,b,c;//use for init
//init the maze
for (a=0,b=0,c=pane_width-1;a<pane_height;){
maze[a][b]=2;
maze[a][c]=2;
a++;
}
for (a=0,b=0,c=pane_height-1;b<pane_width;){
maze[a][b]=2;
maze[c][b]=2;
b++;
}
//all is wall
for (a=1;a<pane_height-1;){
for(b=2;b<pane_width-1;){
maze[a][b]=1;
b+=1;
}
a+=1;
for(b=1;b<pane_width-1;){
maze[a][b]=1;
b+=1;
}
a+=1;
}
//init the wallList
Node *head; (错误 6 error C2065: “head”: 未声明的标识符 )
head = creat(); (错误 2 error C2275: “Node”: 将此类型用作表达式非法)
//pick a cell as a part of amze, adding walls of the cell to wallList
maze[1][1]=0;
AddwallList(head, 1, 1);
//printf the maze
for (a=0;a<pane_height;){
for(b=0;b<pane_width;){
printf("%d",maze[a][b]);
b++;
}
a++;
printf("\n");
}
return 1;
}
int main(){
theMaze();
system("pause");
}
用vs2010 和C语言写的。有点不明白为什么已经引用头文件还是不能定义