Demonstrates using the gets_s() library function. - C String

C examples for String:String Console Input

Description

Demonstrates using the gets_s() library function.

Demo Code

#include <stdio.h>

int main( void )
{
    char input[257];
    puts("Enter some text, then press Enter: ");
    gets_s(input);/*from   w  w w.  ja  v a2s  .com*/
    printf("You entered: %s\n", input);

    return 0;
}

Result


Related Tutorials