Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

C++ Programming/Code/Standard C Library/Functions/gets

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

gets #include <cstdio> char *gets( char *str ); The gets() function reads characters from stdin and loads them into str, until a newline or EOF is reached. The newline character is translated into a null termination. The return value of gets() is the read-in string, or NULL if there is an error. gets() does not perform bounds checking, and thus risks overrunning str. For a similar (and safer) function that includes bounds checking, see fgets(). Related topics fgetc - fgets - fputs - puts