Practice mode C Language

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.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.