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

fgets()


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


Description:
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:
None


Web Standards & Support:

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