Jump to content

C++ Language/Std/CRuntime/HeapMemory/Allocation

From Wikibooks, open books for an open world

Dynamic memory management with the C-Runtime is done by calling malloc(), which returns a pointer to the newly-allocated memory. Give that pointer to free() when you are ready to deallocate that memory.

Additional information about dynamic memory allocation (includes interactive examples)