For one of my college classes using C++, we have to implement a class that creates time objects and that can do different arithmetic functions (+, -, -=, +=, etc...) between two different times.
My teacher told us that for this lab, the different components of calendar time (hours, minutes, seconds) are type unsigned int.
We have an issue when subtracting between different times. Since the type is unsigned int, if t1 < t2, then t1 - t2 would result in large number by cyclicity of unsigned int.
How would one go about solving this problem?
Edit: An example would be let's say t1 = 00:00:00 and t2 = 00:00:01. If we were to do t1 - t2, we are supposed to have 23:59:59 as the final answer