Which C library function allocates memory for an array and sets all its bytes to zero?
Correct answer D. calloc()
Explanation
calloc() allocates memory for a given number of elements and initialises every byte to zero, whereas malloc() leaves the allocated memory uninitialised.
Answer checked How we write and check questions
Discussion