Just to check I understand this right:
calloc says : I want a chunk of memory of this size AND it has to be contiguous(consecutive memory locations)
malloc says: I need this memory and I don't care where
you find it and if it's contiguous or not
realloc says: I need to change a previous calloced memory
and it still needs to be contiguous and if the originally allocated memory cannot be expanded, it should try to find a different contiguous memory of the requested size AND
copy the originally allocated data to the new memory block
Is that basically right?
calloc says : I want a chunk of memory of this size AND it has to be contiguous(consecutive memory locations)
malloc says: I need this memory and I don't care where
you find it and if it's contiguous or not
realloc says: I need to change a previous calloced memory
and it still needs to be contiguous and if the originally allocated memory cannot be expanded, it should try to find a different contiguous memory of the requested size AND
copy the originally allocated data to the new memory block
Is that basically right?