NAME

SYNOPSIS

DESCRIPTION

The
fgets()
function reads bytes from
stream
into the array pointed to by
s,
until
n-1
bytes are read, or a newline character is read and transferred to
s,
or an end-of-file condition is encountered.
The string is then terminated with a null byte.

RETURN VALUE

Upon successful completion,
fgets()
returns
s.
If the stream is at end-of-file, the end-of-file indicator for
the stream is set and
fgets()
returns a null pointer.
If a read error occurs, the error indicator for the stream is set,
fgets()
returns a null pointer and sets
errno
to indicate the error.