C++ Programming/Code/Standard C Library/Functions/calloc

From Wikibooks, open books for an open world
Jump to: navigation, search


#include <cstdlib>
void *calloc( size_t num, size_t size);

The function calloc() allocates a block of memory that can store num objects of size size. In addition, the block of memory allocated is set to all zeros.

If the operation fails, calloc() returns NULL.

Related topics
free - malloc - realloc