Currently, I can only search using a string but I don't know how to search a record when the user inputs a 12 digit number (long long data type). I tried to write if(identityC == line) where the original if(strcmp(....) code was at but I didn't get it to work. Any solutions?
char line[255], name[30];
long long identityC;
FILE* fpointer = fopen("123 Hotel Customer.txt", "r");
//printf("\nPlease Enter Your Identity Card Number: ");
//scanf("%lld", &identityC);
printf("\nPlease Enter your Name to Search your Room Booking: ");
scanf("%s", &name);
while (!feof(fpointer))
{
fgets(line, 255, fpointer);
if (strncmp(name, line, strlen(name)) == 0)
printf("%s", line);
}
fclose(fpointer);
return;