INtime SDK Help
gets, gets_s

Gets a line from stdin and stores it in the specified location.

#include <stdio.h>

char *gets (char *buffer);
errno_t gets_s (char *buffer, rsize_t count);

Parameters

buffer
Storage location for input string.
count
gets_s reads at most one less than the number of characters specified by count.

Remarks

The line consists of all characters up to and including the first newline character \n. gets replaces the newline character with a null character \0 before returning the line.

Return Values

Returns its argument.
Success.
A null pointer on error or end-of-file. Use ferror or feof to determine which one has occurred.
Failure.

gets_s returns a pointer to the string. If end-of-file occurs before any characters are read, it returns NULL and the buffer contents remain unchanged. If an error occurs, it returns NULL and the buffer contents are indeterminate. The gets_s() function does not distinguish between end-of-file and error. Use feof or ferror to determine whether an error occurred.

Requirements

Versions Defined in Include Link to
INtime 3.0 intime/rt/include/stdio.h stdio.h clib.lib

See Also

ferror, feof, fgets, fputs, puts