See King Chapter 17 or K&R P. 167
Dynamic Memory Allocation.
By using the three routines below we can implement
dynamically allocated arrays by providing a mechanism for
obtaining a pointer to a block of new memory.
#include <stdio.h>
void* malloc( size_t size );
void* calloc( size_t NumMembers, size_t size );
void free( void* p );
Look at the examples pointers-3.c and its associated output
pointers-3.log
|