How to check if a time_t variable is initialized?
There really isn't a way to check if it has been initialized. If it wasnt initialized it can be any random value which happened to reside in is memory location. You should program in a way that you know it is initialized.
If I want to compute the difference of two time_t vars with the
difftime function, do I need to manually perform any sanity checks
before invokation?
I don't think so. Since time_t is an integer type it is always in a valid state (integers do not have a nan or inf state like floating points), therefore I see no reason you would get an invalid output. I guess you could check that the values of the time_t make sense given the context of the prolbem you are solving. Such as it might not make sense to have one refer to a time 2000 years ago.
Also, since the difftime return value is a double, how do I check that
this value is greater than 0.0?
Use an if statement. if(dt > 0.0) {...}