Starting tinkering with text
This commit is contained in:
10
vagen_till_c/ch2/text1.c
Normal file
10
vagen_till_c/ch2/text1.c
Normal 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);
|
||||
}
|
Reference in New Issue
Block a user