I am new to Cstring, sorry for asking dumb question, please help.
char string[10];
printf("Give me your last name:\n");
scanf ("%s", string); //if i type 123 123
printf("Original string:%s\n", string); //it shows 123
Compare to:
char string[] = "123 123";
printf("Original string:%s\n", string); //it shows 123 123
This is the right behaviour. By default
scanfreads the string until it reaches a whitespace.From
scanfmanpage: