今晚在线讨论
我在把下面函数放到一个程序里运行时出现“Too many types in declaration”,
而仅仅main()调用下面函数却能运行成功,也就是说,函数本身应该没什么问题。可是为什么会出现那情况呢?
我的QQ:93316608
int password_comp(char *s)
{
char ch,cch;
char s1[80];
int i=-1;
int j,len;
memset(s1,'\0',80);
cch='x'; len=strlen(s);
printf("\nplease enter the password:");
do { ch=getch();
if(ch!='\r')
{ printf("%c\a",cch);
i++;s1[i]=ch;}
}while(ch!='\r');
printf("\n\a\a\a\a\a\a\n");
j=strlen(s1);
if((j!=len)||(memicmp(s1,s,j)))
return(0);
else
return(1);
}
void pass(void)
{
int i,kout;
clrscr();
printf("This is library system.\n ");
for(i=0;i<3;i++)
{kout=password_comp("abcdefgh");
if(i==2) { exit(0); }
if(kout==0) printf("Password error!!!Press any key to continue...");
if (kout==1){ printf("\n Password is right!!! You are welcome!\nPress any key to continue... ");
getch();
clrscr();
break;
}
}