PDA

Click to See Complete Forum and Search --> : difference between malloc calloc realloc


arunura
May 2nd, 2001, 12:18 AM
can anybody please tell me the exact difference between calloc malloc and realloc

thanx a lot

Vlatko
May 2nd, 2001, 08:59 AM
calloc
Allocates an array in memory with elements initialized to 0.
void *calloc( size_t num, size_t size );

malloc
Allocates memory blocks.
void *malloc( size_t size );

realloc
Reallocate memory blocks.
void *realloc( void *memblock, size_t size );