Currently At: Programming Reference > C Reference > Stndard C I/O > fgets()


 #include <stdio.h>
 char *fgets( char *str, int num, FILE *stream );

The function fgets() reads up to num - 1 characters from the given file stream and dumps them into str. fgets() will stop when it reaches the end of a line, in which case str will be terminated with a newline. If fgets() reaches num - 1 characters or encounters the EOF, str will be null-terminated. fgets() returns str on success, and NULL on an error.

Related Topics:

Web Standards & Support:

Link to and support Powered by LoadedWeb Web Hosting
Valid XHTML 1.0! Valid CSS! FireFox Extensions