calloc
allocate and initialize memory
Synopsis
#include <stdlib.h>
void *calloc(size_t nmemb, size_t size);
Description
The
function dynamically allocates a range of memory and initial-
calloc
izes all locations to zero. The number of elements (the first argument)
multiplied by the size of each element (the second argument) is the total
memory allocated. The memory may be deallocated with the
function.
Error Conditions
The
function returns a null pointer if unable to allocate the
calloc
requested memory.
Example
#include <stdlib.h>
int *ptr;
ptr = (int *) calloc(10, sizeof(int));
/* ptr points to a zeroed array of length 10 */
See Also
free, malloc,
realloc
VisualDSP++ 3.5 C/C++ Compiler and Library Manual
for ADSP-219x DSPs
C/C++ Run-Time Library
free
3-41
Need help?
Do you have a question about the VISUALDSP++ 3.5 and is the answer not in the manual?
Questions and answers