这个typedef是什么?结构体不是(struct 结构体名)吗?
#include<stdio.h>#include<stdlib.h>
#include"malloc.h"
typedef struct londe
{
int data;
struct londe *next;
}Londe,*head;
typedef struct londe *list;
void creat(list l)
{
int x;
int n,i=0;
scanf("%d",&n);
printf("输入n:%d\n",n);
list p;
p=(list)malloc(sizeof(londe));
while(p->next!=NULL&&i<n)
{
scanf("%d",&x);
i++;
p->data=x;
p->next=l;
l->next=p;
p=(list)malloc(sizeof(londe));
}
}
void output(list current)
{
current=current->next;
while(current)
{
printf("%d\n",current->data);
current=current->next;
}
}
int main()
{
void creat(list);
void output(list);
list m;//
m=(list)malloc(sizeof(londe));
m->next=NULL;
creat(m);
output(m);
return 0;
}