数据库
程序有点错误,求大神指导#define maxsize 20
typedef int Elemtype;
typedef struct
{
Elemtype data[maxsize];
int length;
}sqlist;
Status ListInsert(Sqlist *L,int i,Elemtype e)//在线性表中插入元素
{
int k;
if(L->length==maxsize)
return error;
if(i<1||i>L->length+1)
return error;
if(i<=L->length)
{
for(k=L->length-1;k>=i-1;k--)
L->data[k+1]=L->data[k];
}
L->data[i-1]=e;
L->length++;
return ok;
}
Status Listdelete(Sqlist *L,int i,Elemtype *e)//删除线性表中元素
{
int k;
if(L->length==0)
ruturn error;
if(i<1||i>L->length)
return error;
*e=L->data[i-1];
if(i<L->length)
{
for(k=i;k<L->length;k++)
L->data[k-1]=L->data[k];
}
L->length--;