- Function
Allocate and clear memory.
- Header
- Declaration
void* __fastcall__ calloc (size_t n, size_t size);
- Description
calloc
allocates memory for an array ofn
elements of sizesize
, clears the whole block with binary zeroes and returns a pointer to it. On error (not enough memory available),calloc
returnsNULL
.- Limits
- Clearing the memory may not have the expected effect on all platforms: pointers in the block may not be
NULL
and floating point variables may not be zero (0.0). In other words: The "clearing" effect of this function should be used with care for portable programs.- The function is only available as fastcall function, so it may only be used in presence of a prototype.
- Availability
ISO 9899
- See also
_heapadd, _heapblocksize, _heapmaxavail, _heapmemavail, free, malloc, realloc
- Example
None.