Difference between revisions of "Fgets"

From Bennu Wiki
Jump to navigation Jump to search
 
(No difference)

Latest revision as of 02:43, 15 March 2012


Definition

STRING fgets ( <INT filehandle> )

Reads a line from a certain file and returns it. Subsequent calls will return the next line, until the end of the file is reached.

Parameters

INT filehandle - The FileHandle of the file returned by fopen().

Returns

STRING: The line read.

Notes

The returned string normally does not contain the '\n' or '\r','\n' charactersets.

When a line ends with the character '\', the next line will be joined with the current one, changing the '\' character to a '\n' character.

If you want to read multiple lines from a textfile, put this function in a loop.