大神们,求教啊!为什么这个程序中的intputseqlist和createlist在vc6中不能识别啊?
#include<stdio.h>#include<stdlib.h>
#define MAXSIZE 100
typedef struct
{
int data[MAXSIZE];
int last;
}seqlist;
int creatlist(seqlist *l)
{
l=(seqlist*)malloc(sizeof(seqlist));
l->last=0;
return 1;
}
void inputseqlist(seqlist *l,int n)
{
l->data[l->last]=n; l->last+=1;
}
void outputseqlist(seqlist *l)
{
int i;
printf("output this list\n");
for(i=0;i<l->last;i++)
printf("%d\n",l->data[i]);
printf("\n");
}
seqlist* search(seqlist *l,int e)
{
int i=0;
while(i < l->last && l->data[i]!=e)
i++;
if(i<=l->last)
return (l);
else return (0);
}
int main()
{
seqlist *l;
int i,status,n,pos;
status=createlist(l);
printf("please input database");
scanf("%d",&n);
intputseqlist(l,n);
outputseqlist(l);
e=2;
l=search(l,e);
printf("第%d个元素是2\n",i);
return 0;
}