gets
Gets a string of characters from stdin and stores them in an array
#include <stdio.h>
char *gets (
char *buf);
The gets function returns buf if successful. It returns NULL if a read error occurs.
The gets function gets a string of characters from the file designated by stdin and stores them in the array pointed to by buf until a newline character is read. Any newline character is discarded, and a NULL character is placed immediately after the last character read into the array.
It is recommended that fgets be used instead of gets because data beyond the array buf is destroyed if a newline character is not read from the input stream stdin before the end of the array buf is reached.
#include <stdio.h>
main ()
{
char buffer[80];
while (gets (buffer) ) != NULL)
puts (buffer);
}