mardi 24 août 2021

What is the point of using both malloc and calloc if their work is the same? [duplicate]

If both malloc and calloc allocate memory contiguously then why two functions were made? We could work with only one. I understand their might be slight differences and pros and cons for each function but still, why both were made? We could do the work with malloc only instead of calloc.

Aucun commentaire:

Enregistrer un commentaire