Section 16.9. Dynamic Memory Management


16.9. Dynamic Memory Management

Many programs, including those that work with dynamic data structures for example, depend on the ability to allocate and release blocks of memory at runtime. C programs can do that by means of the four dynamic memory management functions declared in the header stdlib.h, which are listed in Table 16-22. The use of these functions is described in detail in Chapter 12.

Table 16-22. Dynamic memory management functions

Purpose

Function

Allocate a block of memory

malloc( )

Allocate a memory block and fill it with null bytes

calloc( )

Resize an allocated memory block

realloc( )

Release a memory block

free( )




C(c) In a Nutshell
C in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596006977
EAN: 2147483647
Year: 2006
Pages: 473

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net