In C memory allocation/deallocation done by malloc
and free
.
In C++ memory allocation/deallocation done by new
and delete
.
There are some solutions in C++ for automatic memory management like:
But how can I do automatic memory management in C?
Is there any solutions for AUTOMATIC memory management in C?
Is there any guidelines or something like that for C?
I want when I foget free
a block of memory:
-- or --
And then I say: Oh, C is better than C++, Java and C#. :-)
You may use a Boehm garbage collector library.