Which of the following is correct?

163. Which of the following is correct?

  1. "ptr = calloc(a, b)" is equivalent to ptr = malloc(a * b); memset(ptr, 0, a * b);
  2. "ptr = calloc(a, b)" is equivalent to ptr = malloc(a * b);
  3. "ptr = calloc(a, b)" is equivalent to ptr = malloc(a); memset(ptr, 0, a);
  4. "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.

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.