永发信息网

C语言 主函数用void ,错误显示意外的类型void,还要求在void main()后加“;”

答案:2  悬赏:10  手机版
解决时间 2021-01-19 21:39
  • 提问者网友:火车头
  • 2021-01-19 00:50
C语言 主函数用void ,错误显示意外的类型void,还要求在void main()后加“;”
最佳答案
  • 五星知识达人网友:西岸风
  • 2021-01-19 02:24
void main()
{
while (1)
{
int a;
char f;
char ch[10];
char num[20]= {"12345"};
printf("please input the secreat:\n");
scanf ("%s",&ch);
if (strcmp(num,ch)==0)
a=1;
if(a==1)
{
printf("\nplease enter in the telproject !\n");
f=getchar();
getchar();
break;
}
else
{
printf("\n the secret is error!\n");
printf("please input the right secret.\n");
}
}
while(1)
{
switch(menu())
{
case'1':
append();
break;
case'2':
display();
break;
case'3':
search();
break;
case'4':
modify();
break;
case'5':
delet();
break;
case'6':
exit(0);
break;

}
}

}
全部回答
  • 1楼网友:佘樂
  • 2021-01-19 03:52
你最后面多了个大括号追问删了最后那个},就出现又一个错误:与左侧的 大括号“{”匹配之前遇到文件结束追答先把程序格式调整一下,每行缩进调整好,看括号是否对应
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯