NAME | SYNOPSIS | API RESTRICTIONS | DESCRIPTION | RETURN VALUES | ATTRIBUTES | SEE ALSO
$(OS_DIR)/lib/libc.a #include <stdio.h>char * gets(char * s);
The function or functions documented here may not be used safely in all application contexts with all APIs provided in the ChorusOS 5.0 product.
See API(5FEA) for details.
The gets() function reads characters from the standard input stream, stdin , into the array pointed to by s , until a new-line character is read or an end-of-file condition is encountered. The new-line character is discarded and the string is terminated with a null character.
The fgets() function reads characters from stream into the array pointed to by s , until n -1 characters are read, or a new-line character is read and transferred to s , or an end-of-file condition is encountered. The string is then terminated with a null character.
If end-of-file is reached and no characters have been read, no characters are transferred to s and a NULL pointer is returned. If a read error occurs (for eample, if you are using these functions on a file that has not been opened for reading), a NULL pointer is returned. Otherwise s is returned.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
NAME | SYNOPSIS | API RESTRICTIONS | DESCRIPTION | RETURN VALUES | ATTRIBUTES | SEE ALSO