Next: Formatted Output, Previous: Simple Output, Up: C-Style I/O Functions
Read characters from a file, stopping after a newline, or EOF, or len characters have been read. The characters read, excluding the possible trailing newline, are returned as a string.
If len is omitted,
fgetlreads until the next newline character.If there are no more characters to read,
fgetlreturns −1.
Read characters from a file, stopping after a newline, or EOF, or len characters have been read. The characters read, including the possible trailing newline, are returned as a string.
If len is omitted,
fgetsreads until the next newline character.If there are no more characters to read,
fgetsreturns −1.