anon10128
21-08-2013, 08:17 AM
Hi sir,
Is there any diffrence between malloc and calloc in terms of memory allocation?
The malloc() function allocates size bytes and returns a pointer to the allocated memory.
The calloc() function allocates memory for an array of nmemb elements of size bytes each and returns a pointer to the allocated memory.
This is from man page. I did not understand the difference between the two? Please help me.
Thank you.
Is there any diffrence between malloc and calloc in terms of memory allocation?
The malloc() function allocates size bytes and returns a pointer to the allocated memory.
The calloc() function allocates memory for an array of nmemb elements of size bytes each and returns a pointer to the allocated memory.
This is from man page. I did not understand the difference between the two? Please help me.
Thank you.