#define OK 1
#define ERROR 0
#define TRUE 1
#define FALSE 0
typedef int Status;
//Status是函数的类型,其值是函数结构状态代码如OK等
//初始条件:顺序线性表L已经存在,1<=i<=ListLength(L)
//操作结果,用e返回L中第i个数据元素的值
Status GetElem(SqList L,int i,ElemType *e)//线性表 索引位置 存放指针
{
if(L.lengeth==0||i<1||i>L.length)//或
{
return ERROR;
}
*e=L.data[i-1];//把数放在e里
return OK;
}
数据结构——线性表加强篇
最新推荐文章于 2024-07-25 11:43:17 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)