gets - C stdio.h

C examples for stdio.h:gets

Type

function

From


<cstdio>
<stdio.h>

Description

Get string from stdin

Prototype

char * gets ( char * str );

Parameters

ParameterDescription
str Pointer to a block of memory (array of char).

Return Value

On success, the function returns str.

Demo Code


#include <stdio.h>

int main()//from   w ww .  j  a  v a  2s  .  c o  m
{
  char string [256];
  printf ("Insert your full address: ");
  gets_s(string);
  printf ("Your address is: %s\n",string);
  return 0;
}

Related Tutorials