69,382
社区成员
发帖
与我相关
我的任务
分享
#include <stdio.h>
#include <stdlib.h>
#define LIST_INIT_SIZE 100
#define LISTINCREMENT 10
typedef int ElemType;
typedef struct {
ElemType *elem;
int length;
int listsize;
}Sqlist, Sq;
int InitList_Sq(Sqlist *list)
{
list->elem = (ElemType *)malloc(LIST_INIT_SIZE * sizeof(ElemType));
if (!list->elem)
exit(-1);
list->length = 0;
list->listsize = LIST_INIT_SIZE;
return 0;
}
int main(int argc, char **argv)
{
int result = 0;
Sqlist *list;
InitList_Sq(list);
printf("Init list success.\n");
return result;
}