I have a variable that is defined:
SYSTEMTIME m_TOTime;
And I call GetSystemTime Function to get the UTC Time:
GetSystemTime( &m_TOTime );
Is it possible to determine if GetSystemTime has been called to set m_TOTime? I have another function that uses this variable, but if GetSystemTime has not been called (which sometimes it doesnt have to be) it returns a blank object. I was hopeing something like m_TOTime == null would work.
Use an initializer.
In general, you cannot do this if all possible values of the variable are “legal”, but assuming time travel is impossible, the year will never be zero after GetSystemTime() is called.
If all possible values were legal, you would need to use an auxiliary “bool m_TOTime_initialized = false” variable or somesuch.