Tuesday, January 11, 2011

Its dynamic memory allocation and management - bell's personal space

 First, the dynamic memory
static memory, 1 is assigned a fixed memory size, when you need larger or smaller when you can not change the .2 early distribution.
Dynamic memory is: 1 implemented in the program the allocation of dynamic memory allocation or memory recovery methods. dynamic memory by the system according to the needs of real-time allocation process, 2 and the size distribution of the size of that procedural requirements.
Second, dynamic memory allocation and management
1, malloc function prototype is: void * malloc (unsigned int size)
role of the dynamic storage area in memory of length size distribution of a continuous space. The return value is a pointer to the allocated storage area of the initial continuous address pointer. If you do not successfully allocate storage space (such as memory) will return a NULL pointer. so call this function, you should test whether the NULL return value and act accordingly. 

No comments:

Post a Comment