假设我在二进制while(!feof(fp))
{
fread(&w[i],sizeof(w[i]),1,fp);
cekun=strcmp(nama,w[i].nama);
cekpw=strcmp(pass,w[i].pass);
if(cekun==0&&cekpw==0)
{
system("cls");
printf("\n\n\n\t\t\tLOGIN SUCCESSFUL!");
break;
}
else if(cekun==0)
{
printf("\n\n\n\t\t\tWRONG PASSWORD!");
printf("\n\n\t\t\t\t (PRESS [Y] TO RE-LOGIN)");
if(getch()=='y'||getch()=='Y')
system("cls"); login();
}
else if(cekun!=0&&cekpw!=0)
{
printf("\n\n\n\t\t\tYOU ARE NOT REGISTERED\n ...
中有整数。如何将其三个最小位设置为特定值(例如for each entry in file
if names match
if passwords match
login success
else
login failure
unknown user
)?我期望的结果是11111111B
。