Learning by doing: Reading books and trying to understand the (code) examples
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
#include <stdio.h>
|
|
#include <string.h>
|
|
|
|
|
|
|
|
int main (void) {
|
|
|
|
char first_name[20];
|
|
|
|
printf("Your first name: ");
|
|
scanf("%s", first_name);
|
|
|
|
printf("Your name: \"%s\"\n", first_name);
|
|
printf("Your name: \"%20s\"\n", first_name);
|
|
printf("Your name: \"%*s\"\n", (int)(strlen(first_name)+3), first_name);
|
|
|
|
return 0;
|
|
|
|
}
|