Where and how does ctime allocate memory?

I use the ctime function to get a readable representation of a variable time_t. ctimedeclared as follows:

char *ctime (const time_t *timer);

and you can see that it returns a pointer to the received char array without the char pointer passed in the arguments. Thus, I wonder where the ctimechar buffer is allocated and who will destroy it and will not allocate the internal memory function (with the exception of various malloc, of course), which are considered riots.

Any suggestions?

+3
source share
1 answer

From the link you provide:

, , ctime, asctime. , ,

, , -.

POSIX 2008 ctime_r, ( ), C ++.

+6

All Articles