datetime - MSVC localtime vs localtime_s -
i'm using msvs 2008, , have problem time conversions.
this works fine:
time_t rawtime; struct tm * timeinfo; time (&rawtime); timeinfo = localtime (&rawtime); strftime (lbuf, 256, "timestamp = %a, %d/%m/%y %t\0", timeinfo);
but 1 crashes:
time_t rawtime; struct tm timeinfo; time (&rawtime); localtime_s (&timeinfo, &rawtime); strftime (lbuf, 256, "timestamp = %a, %d/%m/%y %t\0", &timeinfo);
the crash occurs on strftime call, why?
Comments
Post a Comment