怎么错了?
#include<stdio.h>#include<stdlib.h>
#define MAXSIZE 100
#define OVERFLOW 0
typedef int ElemType;
typedef void Status;
typedef struct
{
ElemType *elem;
int length;
}SqList;
Status IintList_Sq(SqList &L)
{
L.elem=(ElemType*)malloc(MAXSIZE*sizeof(ElemType));
if(!L.elem)exit(OVERFLOW);
L.length=0;
}
Status Init_Sq(SqList &L)
{
IintList_Sq(L);
int i;
for(i=0;i<10;i++)
{
scanf("%d",L.elem[i]);
L.length++;
}
}
Status Out_Sq(SqList &L)
{
int i;
for(i=0;i<L.length;i++)
printf("%5d",L.elem[i]);
printf("\n");
}
int compare(int x,int y)
{
if(x==y) return 1;
else return 0;
}
int LocateElem_Sq(SqList L,int e)
{
int i=0;
ElemType *p=L.elem;
while(i<1,L.length&&!(compare(*p++,e)))
i++;
if(i<=L.length)
return 1;
else return 0;
}
void main()
{
int e,m;
SqList L;
Init_Sq(L);
Out_Sq(L);
printf("输入要查找的值\n");
scanf("%d",e);
m=LocateElem_Sq(L,e);
if(m==1) printf("%d",e);
else printf("没找到\n");
}
输入的时候会弹出窗口说错误.