I have a time_t type variable (from <time.h>
) that stores the time of a failure, and would like to initialize it to a "null" value that will be the final value if no error occurs. Is there a standard way to set a time_t variable to some kind of known null value? I see that the time()
function returns -1 if an error occurs, maybe this is best, but wonder if I can just assign an integer value to a typedef like that. Maybe I'd need to use this...?
time_t failTime = (time_t)(-1);