
用c语言写法,怎么一直报错。
24行一直报错
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#define OK 1
#define OVERFLOW -2
#define ERROR 0
#define MAXSIZE 100 //最大长度
typedef int ElemType;
typedef int Status;
typedef struct LNode{
ElemType data; //数据域
struct LNode *next; //指针域
}LNode,*LinkList;
// *LinkList为Lnode类型的指针
//初始化
Status InitList_L(LinkList L){
L= (LNode*)malloc(sizeof(LNode));
L->data = (ElemType*)malloc(sizeof(ElemType));
L->next = (LNode*)malloc(sizeof(LNode));
L=new LNode; //生成新结点作头结点,用头指针L指向头结点。
L->next=NULL; //头结点的指针域置空。
return OK;
}
int main() {
LinkList L;
InitList_L(&L);
return 0;
}