Memory allocation routines are declared in stdlib.h and are a part of the C Runtime Library. There are two very similar allocation routines – malloc() and calloc() – which are used to allocate a new block of memory from the heap. The main difference between malloc() and calloc() is that calloc() clears the memory block it allocates, whereas malloc() only does allocation. There is a third routine, realloc(), which is used to resize an existing block of heap memory. These functions have the following prototypes:
void* malloc( size_t size );
void* calloc( size_t count , size_t size );
void* realloc( void *ptr , size_t size);
Somewhere in stdlib.h, size_t is defined as follows:
type unsigned int size_t;
Each of these functions returns a void* pointer to a block of memory in the heap space...