malloc()
allocates the specified number
of bytes of memory and returns a pointer to it.
<cstdlib>
.
void* malloc(int numBytes);
free()
deallocates the memory pointed to
by the specified pointer.
<cstdlib>
.
void free(void* ptr);
malloc()
.
type* ptr = (type*) malloc(sizeof(type));
type* aptr = (type*) malloc(size * sizeof(type));
DynamicSorterC.cpp
This page was last modified on Oct 25, 2000
URL: http://people.hsc.edu/faculty-staff/robbk/Coms262/Lectures/DynamicMemoryC.html