19/06/2014
Difference between malloc and calloc?
There are two differences between these functions:-
-->First, malloc() takes a single argument (the amount of memory to allocate in bytes), while calloc() needs two arguments (the number of variables to allocate in memory, and the size in bytes of a single variable).
-->Secondly, malloc() does not initialize the memory allocated, while calloc() initializes all bytes of the allocated memory block to zero.
Function Description
malloc -- allocates the specified number of bytes
realloc -- increases or decreases the size of the specified block of memory. Reallocates it if needed
calloc -- allocates the specified number of bytes and initializes them to zero
free --- releases the specified block of memory back to the system