#include <stdlib.h>

void* calloc( size_t n, size_t size );

Allocates n * size bytes of contiguous storage. Sets all bits to zero and returns the address of the first byte allocated. (Don't forget to cast the void pointer to something useful). If storage cannot be allocated, function returns NULL. See also malloc().

Back to Essential C Functions.