顺序表一直报错,求高手解答
#include <stdio.h>#include <stdlib.h>
#define INIT_LIST_SIZE 100;
#define INITINCREMENT 10;
typedef int ElemType;
typedef struct List
{
ElemType * elem;
int length;
int listsize;
}list;
void Init_list(list * L);
int main(void)
{
list L;
Init_list(&L);
return 0;
}
void Init_list(list * L)
{
(*L).elem = (ElemType *)malloc(INIT_LIST_SIZE * sizeof(ElemType));//这行一直报错
if(!(*L).elem)
{
exit(-1);
}
else
{
(*L).length = 0;
(*L).listsize = INIT_LIST_SIZE;
}
return;
}
error:
pfl_list_1.cpp
E:\c自学视频\c\pfl_list_1.cpp(51) : error C2143: syntax error : missing ')' before ';'
E:\c自学视频\c\pfl_list_1.cpp(51) : error C2059: syntax error : ')'
E:\c自学视频\c\pfl_list_1.cpp(51) : error C2100: illegal indirection
Error executing cl.exe.