| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 850 人关注过本帖
标题:出现这个报错是什么意思?
取消只看楼主 加入收藏
yu497272290
Rank: 1
等 级:新手上路
帖 子:26
专家分:0
注 册:2013-11-2
结帖率:42.86%
收藏
 问题点数:0 回复次数:2 
出现这个报错是什么意思?
程序代码:
# 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

能帮忙改对吗?
2014-10-15 21:54
yu497272290
Rank: 1
等 级:新手上路
帖 子:26
专家分:0
注 册:2013-11-2
收藏
得分:0 
有人吗
2014-10-15 22:22
yu497272290
Rank: 1
等 级:新手上路
帖 子:26
专家分:0
注 册:2013-11-2
收藏
得分:0 
有人吗
2014-10-17 12:06
快速回复:出现这个报错是什么意思?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.022261 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved