帮忙看看我这个链表的建立和遍历哪儿错了??求求各位高手
#include <stdio.h>#include <string.h>
#include <stdlib.h>
#define MAX 24
typedef struct worker{
char name[MAX];
int sex;
int age;
int time;
}worker;
worker*createlist()
{
worker *head *pri_p, *cur_p;
int i ;
head = (worker*) malloc (sizeof(worker));
head = cur_p;
for (i=0;i<4;i++)
{
pri_p = (worker*)malloc (sizeof(worker));
scanf("%s",cur_p->name);
scanf("%d",cur_p->sex);
scanf("%d",cur_p->age);
scanf("%d",cur_p->time);
cur_p->next=pri_p;
cur_p=pri_p;
}
cur_p->next=NULL;
free(cur_p);
}
worker*bianli(){
worker *cur_p ;
head = (worker*) malloc (sizeof(worker));
head = cur_p ;
while(cur_p)
{
printf("%s" "%d" "%d" "%d\n",cur_p->name,cur_p->sex,cur_p->age,cur_p->time);
cur_p=cur_p->next;
}
}