gets()

The gets() function reads characters from the standard input device and assigns them to the specified string. Reading of characters stops when the newline character is reached. This function does not check for buffer length and always results in a vulnerability. Here is its syntax:

char *gets ( char *str);

Here, str represents the pointer to the string (array of characters) to which the read characters are assigned.

On successful execution, the function returns str and NULL if any error occurs.