![]() |
C language
What is the difference between malloc() and calloc()?
|
Basically there is no difference between the two besides calloc() zero-initializes the buffer, while malloc() leaves the memory uninitialized.
|
hi, thevyakar
There are two major differences between malloc and calloc in C programming language: first, in the number of arguments. The malloc() takes a single argument, while calloc() takess two. Second, malloc() does not initialize the memory allocated, while calloc() initializes the allocated memory to ZERO. |
Thank you all for your answers :)
|
All times are GMT -7. The time now is 02:07 PM. |
Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.