Is there a one-liner that will free the memory that is being taken by all pointers you created using mallocs? Or can this only be done manually by freeing every pointer separately?
Is there a one-liner that will free the memory that is being taken by
Share
you could do that by creating some kind of “wrapper” around malloc.
(warning that’s only pseudo code showing the idea, there is no checking at all)
But it doesn’t sound like a good idea and I would certainly not do that, at least for general purpose allocation / deallocation. You’d better allocate and free memory responsibly when it is no longer needed.