Use gets_s to read string - C String

C examples for String:String Console Input

Description

Use gets_s to read string

Demo Code

#include <stdio.h>
int main()//from  ww w.java 2  s  . com
{
   char friend1[20];
   printf("Name some friend you know:");
   gets_s(friend1);
   printf("Yeah, I think %s is a friend, too.\n",friend1);
   return(0);
}

Result


Related Tutorials