Code:
char date[20];
printf("Date: ");
scanf("%[^\t\n]s", &date);
coding error,
Code:
gcc -Wall -o "Space_between_lines" "Space_between_lines.c" (in directory: /home/userx/bin)
Space_between_lines.c: In function 'main':
Space_between_lines.c:16:11: warning: format '%[^
' expects argument of type 'char *', but argument 2 has type 'char (*)[20]' [-Wformat=]
scanf("%[^\t\n]s", &date);
^
Compilation finished successfully.
what is that format trying to get?
EDIT
Code:
char date[20];
printf("Date: ");
scanf("%s", date);
Code:
userx@slackwhere:~/bin
$ ./Space_between_lines
Who is this invitation from: me
Who is this invitation to: you
Date: 12/23/44
Time: 23:34
Duration (h): Where: // not working
Hello you
You are invited to a party the 12/23/44 at 23 in :34.
The party lasts until -233
See you there!meuserx@slackwhere:~/bin
now you need to fix the duration as it skips it. You might want to add
the format you want that date entered in your printf
and put an endline on your last printf
printf("%s\n", host);
this just would require a little fancy coding, for me anyways.
the need to know how it is being added to is needed.
month/day/year
day month year
etc..
Code:
And I need this whole string to be printed out in the message
"You are invited to a party the %s at ..."
"You are invited to a party the 12th of April at ..
so you can get your input then parse it. then print it out how you want.
this is just missing something
Code:
printf("\nDuration (h): ");
scanf("%hd", &duration);
a simple oops mistake.