求大神来解答小小问题
pay *input(){
p1=(pay*)malloc(sizeof(pay));
do
{
if(head==NULL)
head=p1;
printf("\n请输入职工的信息(以工号为0结束):\n");
printf(" 工号:");
scanf("%d",&p1->num);
if(&p1->num==0)
{
free(p1);
break;
}
printf(" 姓名:");
gets(p1->name);
printf(" 工资月份:");
scanf("%d",&p1->month);
printf(" 基本工资:\n");
scanf("%f",&p1->shouldpay);
printf(" 应付扣款:\n");
scanf("%f",&p1->rebate);
p1->actualpay=p1->shouldpay-p1->rebate;
p2->next=p1;
p2=p1;
p1=(pay *)malloc(sizeof(pay));
}
p2=0
return head;
}
C:\Users\user\Desktop\5.cpp(62) : error C2061: syntax error : identifier 'p2'
怎么改啊