出现这个报错是什么意思?
程序代码:# include<stdlib.h>
# include<stdio.h>
# define MAXSIZE 20
typedef int elemtype;
typedef struct
{
elemtype stack[MAXSIZE];
int top;
}SeqStack;
InitStack(SeqStack *s)
{
s->top=0;
}
PushStack(SeqStack *s,int n)
{
int a,i;
if(s->top>=MAXSIZE)
{
printf("overflow");
return -1;
}
printf("输入%d个元素:",n);
for(i=0;i<n;i++)
{
if(s->top>=MAXSIZE)
{
printf("overflow\n");
return -1;
}
scanf("%d",&a);
s->stack[s->top]=a;
s->top++;
}
return 1;
}
POPStack(SeqStack *s)
{
if(s->top<=0)
{
printf("栈空");
return -1;
}
while(s->top>0)
{
s->top--;
printf("%d ",s->stack[s->top]);
}
return 1;
}
main()
{
int i,n;
SeqStack s;
InitStack(&s); //初始化一个大小为20的栈s
printf("输入要入栈的元素个数:");
scanf("%d",&n);
PushStack(&s,n);
printf("出栈后的元素排序:");
POPStack(&s); //将栈s中的元素依次退栈,再依次存放到栈t中
printf("\n");
}
[Error] C:\Users\lenovo\Documents\C-Free\Temp\未命名8.cpp:14: error: ISO C++ forbids declaration of `InitStack' with no type
[Error] C:\Users\lenovo\Documents\C-Free\Temp\未命名8.cpp:18: error: ISO C++ forbids declaration of `PushStack' with no type
[Error] C:\Users\lenovo\Documents\C-Free\Temp\未命名8.cpp:40: error: ISO C++ forbids declaration of `POPStack' with no type
能帮忙改对吗?









