/* File: rec3.c Records and functions, again */ typedef struct tag { int hour ; int minute ; } time_t ; time_t add75(time_t when) { time_t result ; int min ; min = when.minute + 15 ; result.minute = min % 60 ; result.hour = when.hour + 1 + (min/60) ; return result ; } main() { time_t start, stop ; printf("First Run ...\n") ; start.hour = 10 ; start.minute = 0 ; stop = add75(start) ; printf ("Start at %d:%02d, stop at %d:%02d\n", start.hour, start.minute, stop.hour, stop.minute) ; printf("Second Run ...\n") ; start.hour = 2 ; start.minute = 30 ; stop = add75(start) ; printf ("Start at %d:%02d, stop at %d:%02d\n", start.hour, start.minute, stop.hour, stop.minute) ; printf("Third Run ...\n") ; start.hour = 4 ; start.minute = 45 ; stop = add75(start) ; printf ("Start at %d:%02d, stop at %d:%02d\n", start.hour, start.minute, stop.hour, stop.minute) ; printf("Fourth Run ...\n") ; start.hour = 4 ; start.minute = 90 ; stop = add75(start) ; printf ("Start at %d:%02d, stop at %d:%02d\n", start.hour, start.minute, stop.hour, stop.minute) ; }