读书人

error C2065: #039;end#039; : undeclared ide

发布时间: 2012-04-26 14:01:31 作者: rapoo

error C2065: 'end' : undeclared identifier
struct book *search1(struct book *head)
{
int num;
struct book *p1,*p2;
if(head==NULL) {printf("\nnull list \n");goto end;}
p1=head;
printf("输入查找的要查找的值:");
scanf("%d",num);
while(num!=p1->number && p1->next!=NULL)
{
p2=p1;p1=p1->next;
}
if(num==p1->number)
{
printf("found the book :%d,%s,%s,%s,%s,%d",p1->number,p1->name,p1->writter,p1->press,p1->time,p1->price );
}
else printf("%dnot been found \n",num);
end;
return(head);
}

error C2065: 'end' : undeclared identifier

这个错误是什么情况啊?不明白啊。。。。求解释

[解决办法]
else printf("%dnot been found \n",num);
end;
return(head);

不是分号,应该是 : 号吧
[解决办法]
end后面是冒号吧。
[解决办法]
end后面改成冒号
配合goto end; 使用
[解决办法]
end:

读书人网 >C语言

热点推荐