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 random 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
Explanation: All of the given options are true. See https://www.geeksforgeeks.org/calloc-versus-malloc/ for details.
Quiz of this Question
- C | Dynamic Memory Allocation | Question 5
- C | Dynamic Memory Allocation | Question 6
- C | Operators | Question 17
- C | Dynamic Memory Allocation | Question 1
- C | Dynamic Memory Allocation | Question 2
- Output of C programs | Set 64 (Pointers)
- C | Macro & Preprocessor | Question 15
- C | C Quiz – 113 | Question 1
- Compiling a C program:- Behind the Scenes
- C Quiz – 112 | Question 5