jewee
asked on
Creating a filename using std string.
I am trying to create a filename with a timestamp using strings instead of chars.
ichar curDateTime[25];
time_t currentTime = time(0);
struct tm *temp_time;
temp_time = localtime(¤tTime);
strftime(curDateTime, 30, "%d%b%Y_%H", temp_time);
sprintf(filename, "%s/FILE_%s%02d%02d", filePath, curDateTime, temp_time->tm_min, temp_time->tm_sec);
What would be the easiest way to do this using strings?
ichar curDateTime[25];
time_t currentTime = time(0);
struct tm *temp_time;
temp_time = localtime(¤tTime);
strftime(curDateTime, 30, "%d%b%Y_%H", temp_time);
sprintf(filename, "%s/FILE_%s%02d%02d", filePath, curDateTime, temp_time->tm_min, temp_time->tm_sec);
What would be the easiest way to do this using strings?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.