程序出现 ld returned 1 exit status怎么解决?
编写一个顺序表,求指点一下错误#include<stdio.h>
#include<stdlib.h>
#include<string.h>
typedef struct
{
char name[10];
int num;
}Student;
typedef struct
{
Student *elem;
int length;
}SqList;
void ListInsert(SqList &L,int i,Student e)//在顺序表L中第i个位置插入新元素e
{
int j;
if((i<1)||(i>L.length+1))
printf("ERROR");
for(j=L.length-1;j>=i-1;j--)
L.elem[j+1]=L.elem[j];
L.elem[i-1]=e;
++L.length;
printf("OK");
}
void ListDelete(SqList &L,int i)
{
int j;
if((i<1)||(i>L.length))
printf("ERROR");
for(j=i;j<=L.length-1;j++)
L.elem[j-1]=L.elem[j];
--L.elem;
printf("OK");
}
int main()
{
void ListInsert(SqList,int,Student);
void ListDelete(SqList,int);
SqList L;
L.elem=new Student[10];
Student s;
strcpy(L.elem[0].name,"赵");
L.elem[0].num=1410;
strcpy(L.elem[1].name,"孙");
L.elem[1].num=1411;
strcpy(L.elem[2].name,"李");
L.elem[2].num=1412;
strcpy(L.elem[3].name,"王");
L.elem[3].num=1413;
strcpy(L.elem[4].name,"周");
L.elem[4].num=1414;
strcpy(s.name,"张三");
s.num=12345678;
ListInsert(L,3,s);
ListDelete(L,3);
}