expected primary-expression before '}' token怎么解决?

#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

goto后面不需要执行什么东西的话47行后面 加个分号

还有个问题是phead要和13行的head一样初始化一下。

您好,我是问答小助手,看到您的问题已被解答,欢迎您加入CSDN!

目前问答VIP仅需29元,即可享受5次/月 有问必答服务,了解详情>>>https://vip.csdn.net/askvip?utm_source=1146287632