Top

Discussion

Which of the following is true?

  • A."ptr = calloc(m, n)" is equivalent to following
  • B.r = malloc(m * n);
  • C."ptr = calloc(m, n)" is equivalent to following
  • D.r = malloc(m * n); memset(ptr, 0, m * n);

Answer: B

The name malloc and calloc() are library functions that allocate memory dynamically. It means that memory is allocated during runtime(execution of the program) from heap segment.

No comment is present. Be the first to comment.
Loading…

Post your comment