I'm using ctime function to get a readable representation of time_t
variable. ctime
is declared as follows:
char *ctime (const time_t *timer);
and you can see that it returns a pointer to the resulting char array without any char pointer passed in arguments. Thus I'm wondering where does ctime
allocate char buffer and who will destroy it and isn't allocating memory inside function (except various malloc
's, of course) considered to be a mess.
Any suggestions?