Question: Difference between malloc and calloc

Solution: -- Difference between malloc and calloc
-- Signatures are different
-- Malloc(s);
-- Allocates byte of memory
-- Returns a pointer for enough storage for an object of s bytes



-- Calloc(n,s);
-- Allocates block of memory
-- Returns a pointer for enough contiguous storage for n objects, each of s bytes
-- The storage is all initialized to zeros
-- Calloc(m, n) is essentially equivalent to
p = malloc(m * n);
memset(p, 0, m * n);