怎么调用输出函数,写个主函数测试,有错误,各位帮忙修改下。
#include<stdio.h>#include<stdlib.h>
struct londe
{
int data;
londe *next;
}Londe,*head,*l;
void creat()
{
int x;
londe *p;
head=NULL;
int n,i=0;
scanf("%d",&n);
printf("输入n:%d\n",n);
p=(struct londe*)malloc(sizeof(Londe));
while(p->next!=NULL&&i<n)
{
scanf("%d",&x);
i++;
p->data=x;
p->next=l->next;
l->next=p;
p=(struct londe*)malloc(sizeof(Londe));
}
}
void output()
{
londe *current=head->next;
while(current)
{
printf("%d\n",current->data);
current=current->next;
}
}
int main()
{
void creat();
void output();
return 0;
}