The memory block allocated by a single calloc() call obviously must be contiguous according to the parameters of the function. But successive calls of calloc() may return non contiguous memory blocks, depending on the implementation.
I think calloc can allocate and initialize memory, if the asked memory is available contiguously where as malloc can allocate even if the memory is not available contiguously but available at different locations.
Hi all,
when will malloc allocate non contiguous memory?if it is not contiguous,then there is no need to call the memory as a "block".
So I think, malloc and calloc allocate memory in blocks.two blocks may or may not be contiguous but memory within a block will obviously be contiguous!!!!