0
What is the difference between malloc and calloc?

Open 1 Answers 51 Views Technology
What is the difference between malloc and calloc?

1 Answer

0

A malloc and calloc are memory management functions. They are used to allocate memory dynamically. Basically, there is no actual difference between calloc and malloc except that the memory that is allocated by calloc is initialized with 0. In C language,calloc function initialize the all allocated space bits with zero but malloc does not initialize the allocated memory. These both function also has a difference regarding their number of arguments, malloc takes one argument but calloc takes two.

by (280k points)
...