Thursday, 4 April 2013

Difference Between malloc and alloc Functions



Characteristics
malloc( )
calloc( )
Arguments
malloc() takes only single argument which is amount of memory to allocate in bytes.
calloc() needs two arguments  i.e. No. of variables to allocate in memory, and the size of single variable in bytes.
Memory Initialization
malloc() does not initialize the allocated memory .
calloc() initializes the allocated memory to zero

No comments:

Post a Comment