I have tried using:
scanf("%d %d %d", &hour, &min, &sec);
printf("%d %d %d", hour, min, sec);
but it does not work, I think I have to bypass the ":" but am unsure how to do this.
Cheers
I have tried using:
scanf("%d %d %d", &hour, &min, &sec);
printf("%d %d %d", hour, min, sec);
but it does not work, I think I have to bypass the ":" but am unsure how to do this.
Cheers
Please try:
if (scanf("%d:%d:%d", &hour, &min, &sec) != 3)
…error handling…