What does the following program do, read string and output - C String

C examples for String:String Console Input

Description

What does the following program do, read string and output

Demo Code

#include <stdio.h>
#include <string.h>
int main(void)
{
    char buffer[256];

    printf( "Enter your name and press <Enter>:\n");
    gets_s( buffer );// w w w  . ja  va  2s. co  m

    printf( "\nYour name has %d characters and spaces!", strlen( buffer ));

    return 0;
}

Result


Related Tutorials