I have problem with this project, i try to search an answer on forum but i didn't found nothing.
struct orario {
int hours;
int minutes;
int seconds;
char *format;
}orario1;
int main(int argc, char *argv[]) {
sscanf(argv[1],"%d:%d:%d %s",&orario1.hours,&orario1.minutes,&orario1.seconds,orario1.format);
printf("%d:%d:%d %s",orario1.hours,orario1.minutes,orario1.seconds,orario1.format);
The output is correct for the numerical part but the string(for example AM or PM) is unexpected (null).
I can't recognize my error, can someone find and tell me?!
Thank you.