#include <stdio.h>
#include <malloc.h>
#include <stdlib.h>
#define OVERFLOW -2
#define OK 1
#define ERROR 0
#define LIST_INIT_SIZE 10
#define LISTINCREMENT 10
typedef int Status;
typedef int ElemType;
typedef struct {
ElemType *elem;
int length;
int listsize;
}SqList;
Status InitList_Sq(SqList *L);
Status ListInsert_Sq(SqList *L, int i, ElemType e);
void PrintList(SqList *L);
Status InitList_Sq(SqList L) {
L->elem = (ElemType)malloc(LIST_INIT_SIZE * sizeof(ElemType));
if (!L->elem)
exit(OVERFLOW);
L->length = 0;
L->listsize = LIST_INIT_SIZE;
return OK;
}
void PrintList(SqList *L) {
for (int i = 0; i < L->length - 1; i++) {
printf("%c", L->elem[i]);
}
}
int main() {
SqList sq;
SqList* L = &sq;
Status InitList_Sq(L);
L->length = 6;
L->elem[0] = 1;
L->elem[1] = 2;
L->elem[2] = 3;
L->elem[3] = 4;
L->elem[4] = 5;
L->elem[5] = 6;
void PrintList(L);
return OK;
}