In my programming class, we have
struct Time {
int hours, min, sec;
}
We are to create a method to compute the difference between two times:
Time *timeDiff(const Time *t1, const Time *t2)
I thought I could create the time difference by getting everything in seconds, and then subtracting the two values, but it seems like extra work to do something like
long hour1 = t1->hours;
long min1 = t1->min;
long sec1 = t1->sec;
And then using these values to get the time in seconds, do something similar for the second time, and then subtract. Any thoughts? Thanks!