Starting tinkering with text

This commit is contained in:
2015-10-14 02:26:35 +02:00
parent 5f40a4bfe1
commit 3d602be8f5
3 changed files with 60 additions and 0 deletions

10
vagen_till_c/ch2/text1.c Normal file
View File

@@ -0,0 +1,10 @@
#include <stdio.h>
int main()
{
char name[20];
printf("Enter your name: ");
// scanf("%s", name); // Unsafe since name is limited to 20 characters
scanf("%19s", name); // Much safer
printf("Hello %s\n", name);
}