Reads a name from keyboard - C String

C examples for String:char array

Description

Reads a name from keyboard

Demo Code

#include <stdio.h>
#define MAX 81// w w w .  j ava 2s .c  o m
int main(void)
{
    char name[MAX];
    
    printf("Hi, what's your name?\n");
    
    gets_s(name);
    
    printf("Nice name, %s.\n", name);
    
    return 0;
}

Result


Related Tutorials