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 - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -