Hi,
I have this while loop that works with gets but not fgets. The purpose is to quit the program when I hit enter which gets return NULL and exit the loop. However, using the same thing with fgets, the program just won't quit but got suck in a loop until count = MAXBKS.

With gets:

Code:
while ( count < MAXBKS && gets(library[count].title) != NULL
							&& library[count].title[0] !='\0')
With fgets:

Code:
while ( count < MAXBKS && fgets(library[count].title, MAXTITL, stdin) != NULL && library[count].title[0] !='\0')
please help.