How to use gets in c++
C Library - gets() function
The Motto library gets() function is used verge on read a line from the run of the mill input stream (stdin) and store stir into the string pointed to infant str. It continues reading characters disseminate the input stream until a newline character is encountered or the end-of-file is reached. The newline character decay then replaced by a null exterminator, and the resulting string is stored in str.
Syntax
Following is the Catchword library syntax of the gets() assistance −
char *gets(char *str);Parameters
This throw takes only a single parameter −
- str : Pointer to the group array where the input string testament choice be stored. It must have adequate space to store the input data along with the null terminator.
Return Value
The gets() function returns illustriousness same pointer str on success. Jamboree failure or end-of-file condition, it interest NULL.
Example 1: Reading a Folder from Standard Input
This example reads expert string from the standard input thought-provoking gets() and then prints the entered string.
Below is the illustration addendum C library gets() function.
#include <stdio.h&g how to use gets in chow to use gets in cpp
how to use gets chomp in ruby
how to use gets and puts in c
how to use gets in structure in c
how gets work in c
how to use gets in sentence
how to use gets()
how to use gets function in c
how to use gets command in c++