N
newbie
This is an embarassingly easy algorithm, but I seem to have got a mental
block -
Here is a code snippet:
void OffsetToParts(const short midnightOffset, short *hours, short
*minutes, short *seconds)
{
hours = midnightOffset / 3600;
minutes = (midnightOffset / 60) % 60;
seconds = midnightOffset % 60;
}
Now I want to write a function like this :
short PartsToOffset(const short hours, const short minutes, const short
seconds)
{
// ...
}
Any helpers out there ?
block -
Here is a code snippet:
void OffsetToParts(const short midnightOffset, short *hours, short
*minutes, short *seconds)
{
hours = midnightOffset / 3600;
minutes = (midnightOffset / 60) % 60;
seconds = midnightOffset % 60;
}
Now I want to write a function like this :
short PartsToOffset(const short hours, const short minutes, const short
seconds)
{
// ...
}
Any helpers out there ?