Synopsis
char *gets(char *s);
Description

gets reads characters from standard input into the array pointed to by s until end-of-file is encountered or a new-line character is read. Any new-line character is discarded, and a null character is written immediately after the last character read into the array.

gets returns s if successful. If end-of-file is encountered and no characters have been read into the array, the contents of the array remain unchanged and gets returns a null pointer. If a read error occurs during the operation, the array contents are indeterminate and gets returns a null pointer.