[求助]链表啊...看错哪里了..
帮我更正啊..麻烦打上红字哦..#include "stdio.h"
#include "stdlib.h"
struct Worker{
int num;
char name[20];
char age;
struct Worker *next;
}
main(){
struct Worker *p1,*p2,*head;
p1=p2=head=(struct Worker*)malloc(sizeof(struct Worker));
scanf("%d%s%c",&p1->num,p1->name,&p1->age);
while(p1!=0){
p2->next=p1;
p2=p1;
p1=(struct Worker*)malloc(sizeof(struct Worker));
scanf("%d%s%c",&p1->num,p1->name,&p1->age);
}
p2->next=0;
p1=head;
while(p1!=0){
printf("%d %s %c\n",p1->num,p1->name,p1->age);
p1=p1->next;
}
}