标题:[求助]出现错误local function definitions are illegal
只看楼主
weiteng111
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2006-6-29
 问题点数:0 回复次数:0 
[求助]出现错误local function definitions are illegal

void search(struct department dep[100],struct person per[50])
{

char name[50];
int i,j,k;
printf("请输入查询方式i:");
scanf("%d",i);
printf("please input name:");
scanf("%s",name);
if(i==0){
while(strcmp(dep[j].name,name))
printf("%s",dep[j].number);
}

else {
while(strcmp(per[j].name,name))
printf("%s",per[j].number);
}
}

void main(){
int ch;
printf("please input ch");
scanf("%d",&ch);
struct department dep[100];
struct person per[50];
read();
do{
printf("\n\n \2\2\2\2\2\2\2\2\2\2\2\2\2\2电★话★查★询★系★统\2\2\2\2\2\2\2\2\2\2\2\2\2\2\2\2\n");
printf("\n1添加\n2读取所有\n3查找\n4删除\n5修改\n6退出\n进行那个操作(1,2,3,4,5,6)?");
scanf("%d",&ch);
if(ch==1)
person_add(struct person per[50]);
if(ch==2)
read();
if(ch==3)
search(struct department dep[100],struct person per[50]);
if(ch==5)
person_change(struct person per[50]);
}while(ch!=6);
write();
}



出现错误:D:\123.cpp(97) : error C2601: 'search' : local function definitions are illegal
D:\123.cpp(116) : error C2601: 'main' : local function definitions are illegal
D:\123.cpp(138) : fatal error C1004: unexpected end of file found

搜索更多相关主题的帖子: department function search local 
2006-06-29 21:03



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-75743-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.379345 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved