=(ElemType *)malloc(LISTSIZE*sizeof(ElemType));
//在顺序线性表 L 中第 i 个位置之前插入新的元素 e
int ListInsert(SqList &L,int i,ElemType e)
if (i<1||i>+1) return -1; //i 值不合法
ElemType *newelem=(ElemType *)realloc,+CREMENTSIZE)*sizeof(ElemType));
if(!newelem) exit (-2); //分配失败
for (ElemType *p=&[]);p>=q;--p) *(p+1)=*p; //插入位置及其后的元素后移
//在顺序线性表 L 中删除第 i 个元素,并用 e 返回其值
int ListDelete(SqList &L,int i,ElemType&e)
if (i<1||i> return -1; //i 值不合法
for (++p;p<=q+1;++p) *(p-1)=*p; //被删除元素之后的元素前移