calloc

Allocates memory

#include <stdlib.h>
void *calloc (
        size_t n,
        size_t s
)

Arguments

n Number of blocks to allocate
s Block size

Return Value

A pointer to the allocated memory block is returned. NULL is returned if the allocation failed.

Explanation

An n * s byte block is allocated from the heap. The allocated memory is cleared.

See Also

malloc(), realloc(), free()