Home »
MCQs »
C++ MCQs
Which of the following is correct?
163. Which of the following is correct?
- "ptr = calloc(a, b)" is equivalent to ptr = malloc(a * b); memset(ptr, 0, a * b);
- "ptr = calloc(a, b)" is equivalent to ptr = malloc(a * b);
- "ptr = calloc(a, b)" is equivalent to ptr = malloc(a); memset(ptr, 0, a);
- "ptr = calloc(a, b)" is equivalent to ptr = malloc(a); memset(ptr, 0, a);
Answer: A) "ptr = calloc(a, b)" is equivalent to ptr = malloc(a * b); memset(ptr, 0, a * b);
Explanation:
Option A is correct.