main函数为什么黑提示local function definitions are illegal
#include <stdio.h>#include <stdlib.h>
#include <string.h>
struct system{
int name; /*系统人员姓名录入*/
int number; /*系统人员密码录入*/
int p; /*系统人员电话录入*/
int customer; /*顾客信息录入*/
};
struct sysuser{
char sysname[15];
char sysword[8];
char fename[15];
char feword[8];
}su;
void encrypt(char *pwd);
int inputchoice(struct sysuser *psu);
void encrypt(char *pwd)
{
unsigned int i;
for(i=0;i<strlen(pwd);i++)
pwd[i]=pwd[i]^15;
}
int inputchoice(struct sysuser *psu)
{
FILE *fp;
char usr[30],usr1[30];
char use[30],use1[30];
char pwd[8];
int choice,mychoice;
printf("**********界面管理**********\n");
printf("**********选择人员**********\n");
printf("******1-系统人员,2-服务员******\n");
scanf("%d",&choice);
if(choice==1){
printf("输入系统人员账号:");
scanf("%s\n",su.sysname);
printf("输入密码:");
scanf("%s\n",su.sysword);
strcpy(usr,psu->sysname);
strcpy(pwd,psu->sysword);
encrypt(pwd);
strcat(usr," ");strcat(usr,pwd);strcat(usr,"\n");
if((fp=fopen("c:\\system.txt","r"))==NULL){
printf("File open error!\n");
exit(0);
}
while(!feof(fp)){
fgets(usr1,23,fp);
if(strcmp(usr,usr1)==0){
printf("11-创建系统新用户:\n");
printf("12-用户信息管理:\n");
printf("13-菜单信息管理:\n");
printf("14-综合测评:\n");
printf("15-顾客信息浏览:\n");
}
if(fclose(fp)){
printf("can not close the file!\n");
exit(0);
}
}
if(choice==2){
printf("输入服务员账号:");
scanf("%s",su.fename);
printf("输入密码:");
scanf("%s",su.feword);
strcpy(use,psu->fename);
strcpy(pwd,psu->feword);
encrypt(pwd);
strcat(use," ");strcat(use,pwd);strcat(use,"\n");
if((fp=fopen("c:\\feman.txt","r"))==NULL){
printf("File open error!\n");
exit(0);
}
while(!feof(fp)){
fgets(use1,23,fp);
if(strcmp(use,use1)==0){
printf("21-顾客信息录入:\n");
printf("22-菜单信息:\n");
printf("23-顾客点餐:\n");
printf("24-费用计算:\n");
printf("25-餐桌信息:\n");
}
if(fclose(fp)){
printf("can not close the file!\n");
exit(0);
}
}
return mychoice;
}
int main(void)
{
FILE *fp;
int mychoice;
size=sizeof(struct system);
while((mychoice=inputchoice(psu))!=0){
switch(mychoice){
case 11:
void addnew();/*添加新用户*/
break;
case 12:
void newmanage();/*用户管理*/
break;
case 13:
void menu();/*菜单信息*/
break;
case 14:
void statistics();/*统计函数*/
break;
case 15:
void customer();/*顾客信息管理*/
break;
case 21:
void addcustomer();/*顾客信息录入*/
break;
case 22:
void menu();/*菜单信息*/
break;
case 23:
void food();/*顾客点餐*/
break;
case 24:
void money();/*费用计算*/
break;
case 25:
void desk();/*餐桌信息*/
break;
}
}
return 0;
}
void addnew()
{