std::gets

From Cppreference

< cpp | io | c
Jump to: navigation, search
Defined in header <cstdio>

char *gets( char *str );

Reads stdin into given character string until a newline character is found or end-of-file occurs.

Contents

[edit] Parameters

str - character string to be written

[edit] Return value

str on success, NULL otherwise

[edit] Notes

The bounds checking is not performed therefore this function is extremely vulnerable to buffer-overflow attacks. Use fgets() instead.

[edit] See also

scanf
fscanf
sscanf
reads formatted input from stdin, a file stream or a buffer
(function)
fgets
gets a character string from a file stream
(function)
fputs
writes a character string to a file stream
(function)