顺序表的问题~
红色部分什么意思啊?.....定义、声明?#include<stdio.h>
#include<stdlib.h>
#define MAXSIZE 1000
typedef struct sqlist{
int data[MAXSIZE];
int length;
}sqlist;
int main(){
int e,i,y;
struct sqlist sq;
int list_locateelem(sqlist L,int m);
printf("请输入顺序表的长度:");
scanf_s("%d",&sq.length);
for(i=0;i<sq.length;i++){
sq.data[i]=rand()%100;
printf("%3d",sq.data[i]);
}
printf("\n请输入要查找的元素:");
scanf_s("%d",&e);
y=list_locateelem(sq,e);
if(y!=0){
printf("%d",y);
}
getch();
exit(0);
}
int list_locateelem(sqlist L,int m){
int j=0;
while(j<L.length&&L.data[j]!=m)
j++;
if(j<L.length){
printf("元素");
printf("%d",L.data[j]);
printf("在顺序表排第");
return j+1;
}
else{
printf("你要查找的元素不存在。");
return 0;
}
}