for(i=0;i<requestnum;i++)
{
bookcount++;
printf("\n\nEnter Booking Request #%d", bookcount);
printf("\nLast Name:");
fgets(OneClient[i].LastName,100,stdin);
if(!strcmp(OneClient[i].LastName, "\n"))
{
printf("Processed %d successful requests out of %d submitted
requests.\nGenerating management report.\nThank you for using the hotel
reservation system.\nBye!",succescount, bookcount);
exit(1);
}
printf("First Name:");
scanf(" %s", OneClient[i].FirstName);
}
The fgets does its work in the first loop, but when the second loop occurs, it scans and stores a blank character and doesnt wait for a user input, I used fgets because I need to terminate the loop when a blank is entered by the user. Help fix my problem please?