c - Do I need to free the returned pointer from localtime() function? -


i reading manpages time.h. got far:

time_t = time(0); struct tm * local = localtime(&now); 

now can work time, far good, not find information if duty free() variable local or not.

quoting man page

the 4 functions asctime(), ctime(), gmtime() and localtime() return pointer static data , hence not thread-safe. [...]

so, need not free() returned pointer.


Comments

Popular posts from this blog

php - Extract Text from HTTP referer -

java - Callback from new thread to class from which thread was initiated -

Receive udp packets in android gstreamer -