Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- libc - <b>calloc</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
calloc
======

Syntax
------

     #include <malloc.h>
     
     void *calloc(size_t num_elements, size_t size);

Description
-----------

This function allocates enough memory for NUM_ELEMENTS objects of size
SIZE.  The memory returned is initialized to all zeros.  The pointer
returned should later be passed to free (free:.) so that the   
memory can be returned to the heap.

You may use cfree (xfree:.) to free the pointer also; it just   
calls free.

Return Value
------------

A pointer to the memory, or `NULL' if no more memory is available.

Example
-------

     Complex *x = calloc(12, sizeof(Complex));
     cfree(x);


See Also: free xfree

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson