######求讲解这段代码!!
typedef struct student ElemType;
//顺序表
typedef struct
{
ElemType *elem; // 存储空间的基地址
int length; // 当前长度
}SqList;
Status merge_sq(SqList *L,SqList *L3);
Status InitList(SqList *L) // 构造空的顺序表 L
{
L->elem=(ElemType *)malloc(sizeof(ElemType)*100);
if(!L->elem) exit(OVERFLOW);
L->length=0;
return OK;
}
//将txt1,2中的数据传到顺序表中
Status merge_sq(SqList *L,SqList *L3)
{
FILE *fp;
//把txt1内容输到数组s[3]
int i,k;
p=s;
if((fp=fopen(str1,"rt"))==NULL)
{
printf("cannot open this file");
exit(0);
}
for(i=0;!feof(fp);i++,p++)
fscanf(fp,"%s %s %d %d %d %d\n",&p->name,&p->num,&p->chinese,&p->math,&p->English,&p->total);
fclose(fp);
//把txt2内容输到数组r[3]
int j,n,m;
q=r;
if((fp=fopen(str2,"rt"))==NULL)
{
printf("cannot open this file");
exit(0);
}
for(n=0;!feof(fp);n++,q++)
fscanf(fp,"%s %s %d %d %d %d\n",&q->name,&q->num,&q->chinese,&q->math,&q->English,&q->total);
fclose(fp);
//数组s[3],r[MAXSIZE]合并到数组c[MAXSIZE]
for(j=0;jfor(int l=0,j=i;jfor(j=0;jelem[j+1]=c[j];
L->length=j+1;
for(j=0;jelem[j+1]=c[j];
L3->length=j+1;
return OK;
}