New answers tagged

0

It seems that maybe you haven't grasped the exact purpose of the free() function. Yes, it needs to be called at some point after a malloc call. BUT, not before the code is done using the memory. When the free(destination) line is not commented out, it will release the memory that was allocated by the malloc call. When that happens, the pointer destination ...


Top 50 recent answers are included