INtime SDK Help
fgets, fgetws

Reads a specified number of characters from a stream and stores them in a string.

#include <stdio.h>

char *fgets(char *string, int n, FILE *stream);

#include <wchar.h>

wchar_t *fgetws(wchar_t *string, int n, FILE *stream);

Parameters

string
Storage location for data. The newline character, if read, is included in the string. A null character is appended.
n
Number of characters stored. If n is 1, string is empty.
stream
Pointer to FILE structure.

Remarks

Characters are read from the current stream position up to and including the first newline character \n, up to the end of the stream, or until the number of characters read is n-1, whichever comes first.

fgets is similar to gets; however, gets replaces the newline character with a null character.

fgetws is the wide-character version of fgets.

Return Values

Returns the string.
Success.
A null pointer on error or end-of-file.
Use feof or ferror to determine whether an error occurred.

Generic Text Routines

tchar.h routine _UNICODE not defined _UNICODE defined
_fgetts fgets fgetws

Requirements

Versions Defined in Include Link to
INtime 3.0
INtime 6.0 (for the wide-character and generic text versions)
intime/rt/include/stdio.h
intime/rt/include/wchar.h
intime/rt/include/tchar.h
stdio.h
wchar.h
tchar.h
clib.lib
   
See Also