Question: The function gmtime () transforms a date and time value (epoch seconds) to a struc- ture in which that value is broken down into year,

 The function gmtime () transforms a date and time value (epoch

The function gmtime () transforms a date and time value (epoch seconds) to a struc- ture in which that value is broken down into year, month, day, hours, etc. by re- turning a pointer to a global tm structure, which contains the converted value. Subsequent calls to gmtime () return the same pointer and only update the global structure. a. Write a function that creates a persistent copy of the supplied tm structure on the heap and updates the caller's pointer to point to the copy. void make_persistent (struct tm **time); b. Extend your program with a function that releases a copy of the tm structure and resets the caller's pointer to NULL. void free_persistent (struct tm **time)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!