当前位置: 代码迷 >> C语言 >> [求助]程序在编译时出错
  详细解决方案

[求助]程序在编译时出错

热度:476   发布时间:2006-04-19 15:19:00.0
[求助]程序在编译时出错

#define listsize 100
#include <stdio.h>
#include <stdlib.h>
void error(char *message)
{printf("%d\n",message);
exit(1);
}
struct seqlist{
int data[listsize];
int length;};
void initlist(struct seqlist *l)
{l->length=0;}

void inserlist(struct seqlist *l,int x,int i)
{int j;
if (i<0||i>l->length)
error("position error");
if (l->length>=listsize)
error("overflow");
for(j=l->length-1;j>=i;j--)
l->data[i]=x;
l->length++;
}

void displaylist(struct seqlist *l)
{int i;
puts("now the list is:");
for(i=0;i<l->length;i++)
printf("\n");
return;}
void main()
{struct seqlist *SEQA;
int i,n,t;
SEQA=(struct seqlist*)malloc(sizeof(struct seqlist));
initlist(SEQA);
clrscr();
puts("please input the size of the list:");
scanf("%d",&n);
puts("please input the elements of the list one by one:");
for(i=0;i<n;i++)
{scanf("%d",&t);
insertlist(SEQA,t,i);}
displaylist(SEQA);}
运行出现undefinsd symbo '_insertlist ' in moudle 11.c(11.c是保存文件名)
小弟先谢谢各位了

搜索更多相关的解决方案: int  length  void  

----------------解决方案--------------------------------------------------------
未定义的符号 '_insertlist ' 在模块 11.c
----------------解决方案--------------------------------------------------------

我改正了
但是当我输入数字的时候运行结果很乱
不是所期望 的结果
还想麻烦各位帮我一下


----------------解决方案--------------------------------------------------------
  相关解决方案