#include<stdio.h>
#include <iostream>
#define maxsize 10
void main()
{
typedef struct
{
int data[maxsize];
int Length;
}Sqlist;
Sqlist L;
int insextElem(Sqlist, int, int);
int insextElem(Sqlist &L, int p, int e)
{int i;
if (p<0 || p>L.Length || L.Length > maxsize)
return 0;
printf("输入错误");
for (i = L.Length - 1; i >= p; i--)
L.data[i + 1] = L.data[i];
L.data[p] = e;
L.Length++;
return 1;
}
int deleteElem(sqlist, int, int);
int deleteElem(Sqlist& L, int p, int& e)//定义删除
{
int i;
if (p<0 || p>L.Length - 1)
return 0;
e = L.data[p];
for (i = p; i < L.Length - 1; i++)
L.data[i]=L.data[i + 1];
L.Length--;
return 1;
}
}
本人小白,这个做的是顺序表的插入和删除,但总是报错 这个怎么也改不对,一改又在其他地方报错 百度后说是函数定义的问题
求助各位大神 !!!!!!