SilverScreen Solid Modeler

calloc

calloc

Previous topic Next topic  

calloc

Previous topic Next topic JavaScript is required for the print function  

StandardCLibrary

 

void *calloc( size_t n, size_t s )

 

size_t n;     /* number of items */

size_t s;     /* number of bytes per item */

 

 




Synopsis

#include "stdlib.h"

 

The calloc function attempts to allocate a piece of memory from the heap large enough to hold n items of size s . The memory is set to all zeros.

 

 

Parameters

n is the number of items requested. s is the size of each item, in bytes.

 

 

Return Value

calloc returns a pointer to the beginning of the allocated memory, if successful, and a NULL pointer otherwise.

 

 

Comments

The memory allocated by calloc may be returned to the heap by using free.

 

 

See Also

free , malloc , realloc