What is the main difference between malloc() and calloc() ? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 2

What is the main difference between malloc() and calloc() ?

14th Oct 2020, 3:58 PM
Niranjan.G
Niranjan.G - avatar
1 Antwort
+ 6
As I understand it, `calloc` zero-fills the memory block allocated, while `malloc` just make the allocation, you get a "cleaner" block with `calloc` I guess.
14th Oct 2020, 4:02 PM
Ipang