| Description
This example shows how
to get user input from the keyboard
using the gets( ) function
Code
/*get user data
from the keyboard with gets*/
#include <stdio.h>
char input[20];
main()
{
puts("Please enter your name.");
/*get the users input using gets*/
gets(input);
/*display name that was entered*/
printf("Hello there : %s\n",input);
return 0;
}
Information
tested on Visual C++
6
|