让我明白就好了!谢谢了!
数据结构吧
全部回复
仅看楼主
level 1
老三挺2 楼主
void Initstack(lnearstack *p) /*栈的初始化*/
{
p->top=-1;
}
int Isempty(lnearstack *p) /*判断空*/
{
return(p->top==-1?1:0);
}
int Isfull(lnearstack *p) /*判断满*/
{
return(p->top==stack_size-1?1:0);
}
int push(lnearstack *p,char x) /*进栈操作*/
{
if(p->top==stack_size-1) return(0);
p->top++;
p->a[p->top]=x;
return(1);
}
int pop(lnearstack *p,char *x) /*出栈操作*/
{
if(p->top==-1)
return(0);
else
{
*x=p->a[p->top];
p->top--;
return(1);
}
}
int gettop(lnearstack *p,char *x) /*取栈顶元素*/
{
if(p->top==-1)
return(0);
else
{
*x=p->a[p->top];
return(1);
}
}
int match(char a,char b)
{
int w;
w=((a==41&&b==40?1:0)||(a==93&&b==91?1:0)||(a==125&&b==123?1:0));
return(w);
}

2012年10月28日 06点10分 1
level 1
老三挺2 楼主
这是我定义的几个函数,前面结构体中是一个char数组,和int top;
然后,编译结果,error C2601: 'Isempty' : local function definitions are illegal
其他类似,看了一下,大括号什么的都对。问题究竟出在哪了?
2012年10月28日 06点10分 2
level 1
老三挺2 楼主
fatal error C1004: unexpected end of file found
这是最下面的一个错误:意外结果出现
2012年10月28日 06点10分 3
level 1
老三挺2 楼主
谢谢有爱的吧友们了!!
2012年10月28日 06点10分 4
1