How can you get a number of seconds, passing by reference, converted to hours+mins+secs...
Im thinking hours = second/3600 but to add mins do you need modulo 60? like (seonds/3600) % 60?
I need them to be hours + mins + seconds. For example, if type in 4949 seconds thats converted to 1 hr ... + _mins +_ secs...? Need help finding the formula!
Thanks again!
I think you're on the right track. Divide by 3600 to get number of hours, then mod that initial number by 3600, givin you the remainder. Divide that remainder to get minutes, mod it to get remaining seconds.
Not sure if that works, but it sounds solid
You would need do take the original number and store it in a variable.
Then modulo that number by 3600 and store the result in a separate variable.
Hours is equal to the first variable minus the second variable divided by 3600.
Modulo the second variable by 60 and store the result in a third variable.
Minutes is equal to the second variable minus the third variable divided by 60.
Seconds is equal to the third variable.
EDIT: I'm sure that yours will work, but you're implicitly truncating with the assumption that the data is of type int. Mine is not making that assumption, and so it is explicit.