Skip to content
Related Articles

Related Articles

Improve Article
C | Dynamic Memory Allocation | Question 8
  • Last Updated : 02 Jan, 2020

Which of the following is/are true
(A) calloc() allocates the memory and also initializes the allocates memory to zero, while memory allocated using malloc() has uninitialized data.
(B) malloc() and memset() can be used to get the same effect as calloc().
(C) calloc() takes two arguments, but malloc takes only 1 argument.
(D) Both malloc() and calloc() return ‘void *’ pointer.
(E) All of the above


Answer: (E)

Explanation: All of the given options are true. See https://www.geeksforgeeks.org/calloc-versus-malloc/ for details.

Quiz of this Question

Want to learn from the best curated videos and practice problems, check out the C Foundation Course for Basic to Advanced C.
My Personal Notes arrow_drop_up
Recommended Articles
Page :