English
Language : 

CC78K0S Datasheet, PDF (208/520 Pages) NEC – C Compiler Ver.1.30 or Later Language
CHAPTER 10 LIBRARY FUNCTIONS
4-8 gets
I/O Functions
FUNCTION
gets reads a character string.
HEADER
stdio.h
FUNCTION PROTOTYPE
char *gets(char *s);
Function
gets
Arguments
s ... Pointer to input character
string
Return Value
Normal ... s
If the end of the file is
detected without reading a
character
... Null pointer
EXPLANATION
• Reads a character string using the getchar function and stores in the array that s indicates.
• When the end of the file is detected (getchar function returns -1) or when a line feed character is read, the
reading of a character string ends. The line feed character read is abandoned, and a null character is written
at the end of the last character stored in the array.
• When the return value is normal, it returns s.
• When the end of the file is detected and no character is read in the array, the contents of the array remain
unchanged, and a null pointer is returned.
208
User’s Manual U14872EJ1V0UM