我在网上看到一段代码。是关于单链表操作的,但主函中
A:printf("1.交集 2.并集 3.差集 4.退出\n");
这种形式,没有见过,也没有报错。请问是什么意思?
void main(linklist head1,linklist head2,linklist head3)
{
int x;
printf("输入完成后请按回车键\n");
head1=(linklist)malloc(sizeof(struct Node));
head1->next=NULL;
head2=(linklist)malloc(sizeof(struct Node));
head2->next=NULL;
head3=(linklist)malloc(sizeof(struct Node));
head3->next=NULL;
printf("请输入集合一\n");
readdata(head1);
printf("请输入集合二 \n");
readdata(head2);
A:printf("1.交集 2.并集 3.差集 4.退出\n");
do{
printf("请选择序号\n");
scanf("%d",&x);
switch(x)
{
case 1:
printf("两个集合的交集是\n");
Insection(head1,head2,head3);
pop(head3);
head3->next=NULL;
break;
case 2:
printf("两个集合的并集是 \n");
Merge(head1,head2,head3);
pop(head3);
head3->next=NULL;
break;
case 3:
printf("两个集合的差集是\n");
Deprive(head1,head2,head3);
pop(head3);
head3->next=NULL;
break;
case 4: break;
default:goto A;
}
}while(x!=4);
}
完整代码:http://www.bccn.net/paste/1892/
A:printf()
其实分为2部分
A:这个是标号
printf()是函数调用
goto A;
这里的意思是跳转到A:那里去执行。