engineering computer science MCQ #2132

What is the difference between `calloc()` and `malloc()`?

engineering computer science MCQ #2132

  1. Question 1

    Q1. What is the difference between `calloc()` and `malloc()`?

    • A) calloc() initializes memory to zero
    • B) malloc() is faster
    • C) calloc() is used for arrays
    • D) malloc() is used for structures

    Answer: calloc() initializes memory to zero

    Explanation: calloc() allocates memory and initializes it to zero, unlike malloc(). NET computer science MCQs often test this core concept.