(ANSI Standard)
#include <stdlib.h> ptr = calloc( N, size );
"calloc" returns a pointer to space for an array of N elements, each of the given size. This space is initialized to zero bits, which will give zero values for an integer or pointer type, but not for floating point types.
Normally the size argument should be specified using the "sizeof" operator.
The ANSI standard requires that "calloc" return a NULL pointer if the desired amount of memory cannot be obtained. This doesn't happen with SS mode GCOS-8 -- if a program asks for more memory and is denied, the program is automatically aborted by the system. Thus, in SS mode, "calloc" will never return the NULL pointer.
Copyright © 1996, Thinkage Ltd.