|
|
#include <stdlib.>void *calloc(size_t num, size_t size);
The calloc( ) function allocates memory the size of which is equal to num * size. That is, calloc( ) allocates sufficient memory for an array of num objects of size size. All bits in the allocated memory are initially set to zero.
The calloc( ) function returns a pointer to the first byte of the allocated region. If there is not enough memory to satisfy the request, a null pointer is returned. It is always important to verify that the return value is not null before attempting to use it.
Related functions are free( ), malloc( ), and realloc( ).
|
|