Defined in header <stdio.h> char *fgets( char *str, int count, FILE *stream ); (until C99) char *fgets( char *restrict str, int count, FILE *restrict stream ); (since C99)
Reads at most count - 1 characters from the given file stream and stores them in str. The produced character string is always null-terminated. Parsing stops if end-of-file occurs or a newline character is found, in which case str will contain that newline character.
Parameters