I'm attempting to create timestamps for my program. On my sister's Mac (using Xcode 4.2) this code works perfectly fine:
struct tm * timeInfo;
time_t rawtime;
time (&rawtime);
timeInfo = localtime (&rawtime);
string timestamp(asctime(timeInfo));
However, on my PC running Visual Studio 2012 I get errors for localtime and asctime that tell me they are unsafe functions and it recommends using localtime_s and asctime_s. However, the function parameters are different. I've tried researching the functions as best I can, but I can't get it to work.
Any help with getting that to work would be much appreciated.
edit:
struct tm * timeInfo;
time_t rawtime;
time (&rawtime);
timeInfo = localtime_s (&rawtime);
string timestamp(asctime_s(timeInfo));