Interview answers verified by specialists.

Find interview questions and answers on this website:


See right interview answers on 30 common job interview questions

What are the differences between malloc() and calloc()?

There are 2 differences.
 First, is in the number of arguments. malloc() takes a single
 argument(memory required in bytes), while calloc() needs 2
 arguments(number of variables to allocate memory, size in bytes of a
 single variable).
 Secondly, malloc() does not initialize the memory allocated, while
 calloc() initializes the allocated memory to ZERO.

Do you know that?

15% freelance part time without any other work commitments Next

Articles: