CS Electrical And Electronics
@cselectricalandelectronics

Difference between malloc and calloc?

All QuestionsCategory: Data StructureDifference between malloc and calloc?
CS Electrical And Electronics Staff asked 3 years ago

I need short information.

1 Answers
Anonymous answered 3 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.