2.1.5 fgets()

int fgets(string s, int n, int filehandle)
Reads, at most, the next n - 1 characters into the string s from the file being associated with filehandle. If a newline is encountered, the newline is included in the string. The string is terminated by "\0".

Note

In contrast to ANSI C, fgets() returns either:
  • The number of characters read.
  • 0 if the end of file was reached or an error associated with filehandle occurred.
Non-ConfidentialPDF file icon PDF versionARM DUI0371M
Copyright © 2007-2014 ARM. All rights reserved.