too few actual parameters哪里出错了啊 10
voidmodify(){structequipmod;intt,i,m,w,addr=-1;charnumber[4]={'\0'},name[11]={'\0'};t...
void modify()
{
struct equip mod;
int t,i,m,w,addr=-1;
char number[4]={'\0'},name[11]={'\0'};
t=load_equ();
do
{
printf("\nInput the equipment number or name(1:the number 2:the name:\n\n)");
printf("What is your choice:[]\b\b");
scanf("%d",&m);
if(m==1||m==2)
w=0;
else
w=1;
} while(w==1);
switch(m)
{
case 1: printf("\n\nPlease input the equipment number:[]\b\b\b");
scanf("%s",number);break;
case 2: printf("\n\nPlease input the equipment name:[]\b\b\b\b\b");
scanf("%s",name);break;
}
for(i=0;i<t;i++)
{
if((strcmp(equ[i].name,name)==0)||(strcmp(equ[i].number)==0)) // 出错的位置
{
addr=i;
printf("\n\nPlease input the new information:\n\n");
printf("number name b_time b_in_time b_out_time g_back_time repair_time s\n");
scanf("%s%s%s%s%s%s%s%d",mod.number,mod.name,mod.b_time,mod.bin_time,mod.bout_time,mod.giveb_time,mod.repair_time,mod.state);
strcpy(equ[i].number,mod.number);
strcpy(equ[i].name,mod.name);
strcpy(equ[i].b_time,mod.b_time);
strcpy(equ[i].bin_time,mod.bin_time);
strcpy(equ[i].bout_time,mod.bout_time);
strcpy(equ[i].giveb_time,mod.giveb_time);
strcpy(equ[i].repair_time,mod.repair_time);
strcpy(equ[i].state,mod.state);
printf("%-3s %-10s %-10s %-10s %-10s %-10s %-10s%d\n\n",equ[i].number,equ[i].name,equ[i].b_time,equ[i].bin_time,equ[i].bout_time,equ[i].giveb_time,equ[i].repair_time,equ[i].state);
break;
}
}
if(addr==1)
{
printf("Cannot find the equipment which you want to modify!\n\n");
printf("Press any key to to back..\n\n");
getch();
menu();
}
save(t,0);
printf("Press any key to go back..\n\n");
getch();
menu();
}
报错error C2198: 'strcmp' : too few actual parameters 展开
{
struct equip mod;
int t,i,m,w,addr=-1;
char number[4]={'\0'},name[11]={'\0'};
t=load_equ();
do
{
printf("\nInput the equipment number or name(1:the number 2:the name:\n\n)");
printf("What is your choice:[]\b\b");
scanf("%d",&m);
if(m==1||m==2)
w=0;
else
w=1;
} while(w==1);
switch(m)
{
case 1: printf("\n\nPlease input the equipment number:[]\b\b\b");
scanf("%s",number);break;
case 2: printf("\n\nPlease input the equipment name:[]\b\b\b\b\b");
scanf("%s",name);break;
}
for(i=0;i<t;i++)
{
if((strcmp(equ[i].name,name)==0)||(strcmp(equ[i].number)==0)) // 出错的位置
{
addr=i;
printf("\n\nPlease input the new information:\n\n");
printf("number name b_time b_in_time b_out_time g_back_time repair_time s\n");
scanf("%s%s%s%s%s%s%s%d",mod.number,mod.name,mod.b_time,mod.bin_time,mod.bout_time,mod.giveb_time,mod.repair_time,mod.state);
strcpy(equ[i].number,mod.number);
strcpy(equ[i].name,mod.name);
strcpy(equ[i].b_time,mod.b_time);
strcpy(equ[i].bin_time,mod.bin_time);
strcpy(equ[i].bout_time,mod.bout_time);
strcpy(equ[i].giveb_time,mod.giveb_time);
strcpy(equ[i].repair_time,mod.repair_time);
strcpy(equ[i].state,mod.state);
printf("%-3s %-10s %-10s %-10s %-10s %-10s %-10s%d\n\n",equ[i].number,equ[i].name,equ[i].b_time,equ[i].bin_time,equ[i].bout_time,equ[i].giveb_time,equ[i].repair_time,equ[i].state);
break;
}
}
if(addr==1)
{
printf("Cannot find the equipment which you want to modify!\n\n");
printf("Press any key to to back..\n\n");
getch();
menu();
}
save(t,0);
printf("Press any key to go back..\n\n");
getch();
menu();
}
报错error C2198: 'strcmp' : too few actual parameters 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询