What is the difference between "calloc" and "malloc"?

Showing Answers 1 - 1 of 1 Answers

Yashwant S pinge

  • Mar 27th, 2006
 

Calloc:- #include void *calloc(size_t nelem, size_t elsize);The calloc() function allocates space for an array of nelem elements of size elsize. The space is initialized to zero. Malloc:#include void *malloc(size_t size);The malloc() function allocates space for an object. malloc() returns a pointer to a block whose size is specified by size and whose value is indeterminate.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions