Question: Implement free (without using the preexisting free function) in C. Given a pointer to a block of memory that you have allocated, implement your own
Implement free (without using the preexisting free function) in C. Given a pointer to a block of memory that you have allocated, implement your own version of free to deallocate this block of memory. At the end, the pointer should still point to the same address but the address should now be invalid (cleared.) If the pointer is a NULL pointer initially, then do nothing.
void free(void *pointer) { // implement free! }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
