Quote:
fgets
char *fgets(char *restrict s, int n, FILE *restrict stream);
The function reads characters from the input stream stream and stores them in successive elements of the array beginning at s and continuing until it stores n-1 characters, stores an NL character, or sets the end-of-file or error indicators. If fgets stores any characters, it concludes by storing a null character in the next element of the array. It returns s if it stores any characters and it has not set the error indicator for the stream; otherwise, it returns a null pointer. If it sets the error indicator, the array contents are indeterminate.
Here's a link: