69,371
社区成员
发帖
与我相关
我的任务
分享
#include<stdio.h>
#include<stdlib.h>
#define TRUE 1
#define FALSE 0
#define OK 1
#define ERROR 0
#define INFEASIBLE -1
#define OVERFLOW -2
typedef int status;
typedef struct{
ElemType *elem;
int length;
int listsize;
}sqlist;
#define LIST_INIT_SIZE 80
#define LISTINCREMENT 10
status InitList(sqlist *s)
{
s->elem=(ElemType *)malloc(LIST_INIT_SIZE*sizeof(ElemType));
if(!s->elem)
exit(OVERFLOW);
s->length=0;
s->listsize=LIST_INIT_SIZE;
return OK;
}
typedef int ElemType;
#include"sequ_list.h"
#include"sequence_list.c"
int main()
{
sqlist a,*sq;
sq=&a;
InitList(sq);
printf("a.elem=%d a.length=%d a.listsize=%d\n",sq->elem,sq->length,sq->listsize);
getchar();
}