calloc
Allocates and clears memory space for an array of objects
#include <stdlib.h> #include <nwmalloc.h> void * calloc ( size_t n, size_t size);
calloc returns a pointer to the start of the allocated memory. The return value is NULL if insufficient memory is available or if the value of the size parameter is 0.
The calloc function initializes all the memory to binary zeroes.
Memory allocation is not limited to 64 KB. The size parameter is 32 bits.
The calloc function calls the malloc function.
A block of memory allocated using the calloc function should be freed using the free function.
#include <nwmalloc.h> #include <stdlib.h> main () { int *memoryPointer; size_t n; memoryPointer = calloc (n, sizeof (int)); }