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

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -