I have read about placing whitespace in front of scanf but I everything I try does not work. I am trying to read in two sets of three integers. The first scanf works fine while the second does not. I am frustrated because I try everything that I see in forums with placing spaces in front or newline characters and nothing works.
Code in question:
// Get user input for the two dates:
printf("Enter Date #1 in format mm:dd:yyyy \n");
scanf("%i:%i:%i\n", &D1.month, &D1.day, &D1.year);
printf("Enter Date #2 in format mm:dd:yyyy\n");
scanf("%i:%i:%i", &D2.month, &D2.day, &D2.year);
I tried to put a space AND a newline character in there separatly and together, I tried to read in a dummy variable character to see if that would work. Why can I not enter any data in the second scanf??
The output is shown:
Enter Date #1 in format mm:dd:yyyy
09:06:1995
Enter Date #2 in format mm:dd:yyyy
The number of days between 0:1529117256:94769206 and 9:6:1995 is -1783102426
I make a new post because I see explanations with characters but not with integers.