English
Language : 

CC78K4 Datasheet, PDF (199/523 Pages) NEC – CC78K4 Ver.2.30 or Later, C Compiler Language
CHAPTER 10 LIBRARY FUNCTIONS
5-3 calloc
Utility Functions
FUNCTION
The memory function calloc allocates an array area and then initializes the area to 0.
HEADER
stdlib. h
FUNCTION PROTOTYPE
void *calloc (size_t nmemb, size_t size);
Function
calloc
Arguments
nmemb ... Number of
members in the array
size ... Size of each member
Return Value
• Pointer to the beginning of
the allocated area if the
requested size is allocated
• Null pointer if the requested
size is not allocated
EXPLANATION
• The calloc function allocates an area for an array consisting of n number of members (specified by nmemb),
each of which has the number of bytes specified by size and initializes the area (array members) to zero.
• If memory cannot be allocated, the function returns a null pointer. (This memory allocation will start from a
break value and the address next to the allocated space will become a new break value. See 5-11 brk for
break value setting with the memory function brk.)
User’s Manual U15556EJ1V0UM
199