English
Language : 

CC78K4 Datasheet, PDF (191/523 Pages) NEC – CC78K4 Ver.2.30 or Later, C Compiler 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 character stored in the array in the end.
• 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.
User’s Manual U15556EJ1V0UM
191