HP 3000 Manuals

calloc [ HP C/iX Library Reference Manual ] MPE/iX 5.0 Documentation


HP C/iX Library Reference Manual

calloc 

Allocates a block of memory.

Syntax 

     #include <stdlib.h>
     void *calloc (size_t nelem, size_t elsize);

Parameters 

nelem         The number of elements, each of size elsize, to be found in
              the block of allocated memory.

elsize        The size, in bytes, of each element specified in nelem.

Return Values 

x             A pointer to the allocated space.

NULL          There is not enough available memory or elsize is zero.

Description 

The calloc function allocates space for an array of nelem elements of
size elsize.  The space is initialized to all bits zero.  It is suitably
aligned for any use.

See Also 

malloc(), free(), realloc(), ANSI C 4.10.3.1, POSIX.1 8.1



MPE/iX 5.0 Documentation