This question has already been answered:

Interested in the code of a possible implementation of the function showing the reasons why the function malloc takes one parameter and calloc two?

Reported as a duplicate by iksuy , Senior Pomidor , αλεχολυτ c ++ Apr 9 '18 at 12:01 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

    1 answer 1

    The calloc function allocates a block of memory for an array of size - num elements, each of which occupies size bytes.

    The malloc function allocates a block of memory of sizemem bytes.