作业帮 > 综合 > 作业

麻烦帮我看一下 这道题哪里错了?

来源:学生作业帮 编辑:搜狗做题网作业帮 分类:综合作业 时间:2024/05/14 06:58:58
麻烦帮我看一下 这道题哪里错了?
#include
#include
#include
#define MAXIZE 30
typedef struct SList
{
int Data[MAXSIZE];
int Last;
}
SList;
SList InitSList()
{
SList L;
L.Last=-1;
return L;
}
SList InputSList( SList L)
{
int x=0;
printf("\n请输入数据,结束输入-1!\n");
scanf("%d",&x);
while (x!=-1)
{
L.Data[++L.Last]=x;
if(L.Last==MAXSIZE-1)
{
printf("\n顺序表已满!\n");
break;
}
scanf("%d",&x);
}
return L;
getch();
}
麻烦帮我看一下 这道题哪里错了?
唯一的问题
return L;
getch(); //如果是用这个来暂停程序 放在return后面永远运行不到
再问: 我用的WIN-TC   后面加getch();才能看到运行结果
再答: getch(); return L;