The gets function

Name

gets -- 

Synopsis

#include <stdio.h>

int gets (char *s );

Description

The gets function reads character from the input stream pointed to by stdin, into the array pointed to by s, until an 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.

Returns

The gets function 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 a null pointer is returned. If a read error occurs during the operation, the array contents are indeterminate and a null pointer is returned.

Implementation Notes

The gets function