time_t rawtime;
struct tm * timeinfo;
time ( &rawtime );
timeinfo = localtime ( &rawtime );
This returns: warning C4996: 'localtime': This function or variable may be unsafe. Consider using localtime_s instead.
time_t rawtime;
struct tm * timeinfo;
time ( &rawtime );
timeinfo = localtime_s ( &rawtime );
When I change localtime to localtime_s I get: error C2660: 'localtime_s' : function does not take 1 arguments
Here is what I think is going on in the first block of code:
- create an empty time_t variable.
- create a pointer to timeinfo which is defined in ctime
- write the rawtime into a rawtime reference
convert the rawtime into something meaningful to pedestrians
- Am I right?
- What second input parameter does localtime_s need?
- What's the worst that could happen if I just ignore the whole localtime safety issue.