The character '/' does not make part of an integer.
When you type a date as, for instance, "11/27/2012", the first scanf successfuly parses the 11 leaving "/27/2012" pending.
The second scanf catches the '/' and stops (as does the third scanf).
What you can do is enter the date without 'strange' symbols, just spaces:
Code:
puts("Enter month day and year separated by spaces");
if (scanf("%d", &tom.month) != 1) /* error */;
/* ... */
or ignore the character in the scanf itself
Code:
puts("Enter month day and year separated by spaces");
if (scanf("%d", &tom.month) != 1) /* error */;
if (scanf("/%d", &tom.day) != 1) /* error */; /* parse and ignore a / */
if (scanf("/%d", &tom.year) != 1) /* error */; /* parse and ignore a / */
Note, putting it all together, for the last option, is (I think) more usual
Code:
puts("Enter month day and year separated by spaces");
if (scanf("%d/%d/%d", &tom.month, &tom.day, &tom.year) != 3) /* error */;
Also, like I did above, you should always check the return value of scanf ...