Difference between malloc and calloc?

All QuestionsCategory: Data StructureDifference between malloc and calloc?
Chetan Shidling Staff asked 4 years ago

I need short information.

1 Answers
Anonymous answered 4 years ago

Malloc
 
The function malloc allocates a block of size bytes from the memory. It allows a program to allocates an exact amount of memory.
 
Calloc
 
The function allocates multiple blocks of memory. The calloc allocates contiguous multiple blocks.