请看这段代码,执行完全没问题,就是fprintf无法写入到文件。。。但之前读取这个文件一点问题都没有。。。
else if (kind==1)
{
custaccF=fopen("c:\\Support\\custacc.txt","a");
do
{
gets(clear);
printf("Please enter your account, if it is your 1st time, we will create one:\n");
gets(account);
if (iscustacc(account)==FALSE)
{
printf("\nAccount does not exist, type in your password to create one.\n");
printf("Please enter your password:\n");
gets(password);
fprintf(custaccF,"%s %s\n",account,password);
printf("\nYour account is successfully created!");
strcpy(customer,account);
right=TRUE;
kind=0;
break;
}
else
{
printf("\nPlease enter your password:\n");
gets(password);
if(custvalid(password)==FALSE)
{
printf("\nWrong Account-Password Combination.(press 'enter' to continue)\n");
continue;
}
else
{
right=TRUE;
kind=0;
break;
}
}
} while (isvalid(password)==FALSE);
}
问题已解决,不知道怎么弄得就好使了(我没进行任何修改。。。= =)。。。
试过了,没有用。。。TT