Navigation

Operators and Keywords

Function List:

C++ API

: str = fgets (fid)
: str = fgets (fid, len)

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, fgets reads until the next newline character.

If there are no more characters to read, fgets returns -1.

To read a line and discard the terminating newline see fgetl.

See also: fputs, fgetl, fscanf, fread, fopen.

Package: octave