#include<stdio.h>
#include<stdlib.h>
#define MAXSIZE 20
typedef int Status
;
typedef int ElemType
;
typedef struct{
ElemType data
[MAXSIZE
];
int length
;
}SqList
;
Status
InitList_Sq(SqList
&L
){
int *p
= L
.data
;
p
= (ElemType
*)malloc(MAXSIZE
* sizeof(ElemType
));
if(! L
.elem
)exit(0);
L
.length
= 0;
return 1;
}
Status
ListInsert_Sq(SqList
&L
,int i
,ElemType e
){
L
.data
[i
-1] = e
;
L
.length
++;
return 1;
}
Status
GetElem(SqList L
,int i
,ElemType
&e
){
e
=L
.data
[i
-1];
return 1;
}
void main(){
SqList L
;
InitList_Sq(L
);
ListInsert_Sq(L
,1,3);
ElemType e
= 0;
GetElem(L
,1,e
);
printf("%d\n",e
);
}
转载请注明原文地址: https://yun.8miu.com/read-58661.html