一个链表的问题
#include <stdio.h>typedef struct Node
{
int data;
struct Node * next;
}Node,*LinkList;
void InitList(LinkList L)
{
L = (LinkList)malloc(sizeof(Node));
L->next = NULL;
}
void CreateFromHead(LinkList L)
{
Node *s;
int number;
int i;
for(i = 0;i < 5;i++)
{
number = scanf("%d",&number);
s = (Node *)malloc(sizeof(Node));
s->data = number;
s->next = L->next;
L->next = s;
}
printf("%d",L->data);
}
void main()
{
int flag;
LinkList LDC ;
InitList(LDC);
CreateFromHead(LDC);
scanf("%d",&flag);
return;
}
哪里错误了! 谢谢