Name

gets function — Reads a string unsafely

Synopsis

char* gets(char* s)

The gets function reads a line of text (up to and including a newline) into the string s.

Warning

There is no way to limit the input to the size of s, so you should never call gets. Use fgets instead.

Get C++ In a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.