#include<iostream>
using namespace std;
struct employee{
int num;
int age;
char sex;
employee *next;
};
employee *head,*head1;
employee *create(){
employee *head,*p,*pend;
char ch;
head=NULL;
cout<<"\t输入数据?(y/n)";cin>>ch;
if(ch=='y'){
p=new employee;
cout<<"\t编号:";cin>>p->num;
cout<<"\t年龄:";cin>>p->age;
cout<<"\t性别:";cin>>p->sex;
}
else
goto L0;
while(ch=='y'){
if(head==NULL)head=p;
else pend->next=p;
pend=p;
cout<<"\t输入数据?(y/n)";cin>>ch;
if(ch=='y'){
p=new employee;
cout<<"\t编号:";cin>>p->num;
cout<<"\t年龄:";cin>>p->age;
cout<<"\t性别:";cin>>p->sex;
}
}
pend->next=NULL;
L0:return head;
}
void show(employee *head)
{
employee *p=head;
if(!head){cout<<"\t空链表!"<<endl;goto L1; }
cout<<"\t链表中的数据是:\n";
while(p){
cout<<'\t'<<p->num<<" "<<p->age<<" "<<p->sex<<endl;
p=p->next;
}
L1:
}
employee *del(int bh){
employee *p,*q;
if(!head){
cout<<"\t空链表!"<<endl;
goto L2;
}
cout<<"\t找不到需要删除结点!"<<endl;
L2:return(head);
}
int main(){
int choice,bh;
L:
cout<<"\n\t\t键入操作选择\n"<<endl;
cout<<"\t1建立单向链表"<<endl;
cout<<"\t2显示链表里员工信息"<<endl;
cout<<"\t3删除指定编号结点"<<endl;
cout<<"\t0退出"<<endl;
cout<<"\t\t";
cin>>choice;
switch(choice){
case 1:head=create();goto L;
case 2:show(head);goto L;
case 3:cout<<"\t输入编号:";
cin>>bh;
head=del(bh);goto L;
case 0:cout<<"\t退出运行\n"<<endl;break;
default:cout<<"\t输入错误,重新输入\n"<<endl;goto L;
}
}
问题是第48行显示链表所有数据那里出错,一直提示expected primary-expression before '}' token