Here is a question which has been bugging me for awhile. In the following example, localtime() returns a pointer to a tm struct (time_info). Should I deallocate this memory, or is this handled automatically?
Code:#include <iostream> #include <time.h> using namespace std; int main(void) { time_t t; struct tm *time_info; char ctime[80]; t = time(NULL); time_info = localtime(&t); strftime(ctime,sizeof(ctime),"%c",time_info); cout << ctime << endl; return 0; }