home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / ansi / stdlib / calloc.txh < prev    next >
Encoding:
Text File  |  1995-07-10  |  720 b   |  31 lines

  1. @node calloc, memory
  2. @subheading Syntax
  3.  
  4. @example
  5. #include <malloc.h>
  6.  
  7. void *calloc(size_t num_elements, size_t size);
  8. @end example
  9.  
  10. @subheading Description
  11.  
  12. This function allocates enough memory for @var{num_elements} objects of
  13. size @var{size}.  The memory returned is initialized to all zeros.  The
  14. pointer returned should later be passed to free (@pxref{free}) so that
  15. the memory can be returned to the heap.
  16.  
  17. You may use cfree (@pxref{xfree}) to free the pointer also; it just
  18. calls free.
  19.  
  20. @subheading Return Value
  21.  
  22. A pointer to the memory, or @code{NULL} if no more memory is available.
  23.  
  24. @subheading Example
  25.  
  26. @example
  27. Complex *x = calloc(12, sizeof(Complex));
  28. cfree(x);
  29. @end example
  30.  
  31.