Any idea why this loop repeats regardless of the input? What I have there does correctly assign the proper values to month, day, and year, but the input prompt is repeated no matter what is input. Obviously I would like it to repeat if an impossible day < 1 or > 31 is input, and also do the same for month and year which I'll add after I get this working.
while(day > 31 || day < 1)
{
printf("Please Enter the Check Date (Format: 01/01/1981): ");
scanf("%s", s);
int month = strtol(s, &ptr, 10);
int day = strtol(++ptr, &ptr, 10);
int year = strtol(++ptr, &ptr, 10);
}