Get string from file.
Reads characters from a file and stores them as a string into str until (num-1) characters have been read or either a newline or a the End-of-File is reached, whichever comes first. A newline character makes fgets stop reading, but it is considered a valid character and therefore it is included in the string copied to str. A null character is automatically appended in str after the characters read to signal the end of the string. Returns the string parameter.
- Parameters
-
str | The string where the characters are stored. |
num | The maximum number of characters to be read. |
handle | The handle of the file from which the characters are read. |
- Returns
- The string read from the file.
- Examples:
- ex_fgets.nxc, and ex_fopen.nxc.