I did what you said, and the problem is the same.The program ends without showing the phrase "Correct id and password".I already have a file containing Ids and passwords.
Code:
#include <stdio.h>
#include <stdlib.h>
FILE *filename;
int main()
{
char tempid[10],tempass[10],c,d;
printf("enter ID:");
scanf("%s",&tempid);
printf("enter PASS:");
scanf("%s",tempass);
filename=fopen("ids.txt","r");
while((c=getc(filename))==tempid&&(d=getc(filename))==tempass)
{
printf("Correct ID and password.");
}
fclose(filename);
return 0;
}