In C, the function ________ is used to allocate memory for an array of elements and initialize them to zero.

  • calloc()
  • free()
  • malloc()
  • realloc()
In C, the function calloc() is used to allocate memory for an array of elements and initialize them to zero. Unlike malloc(), it automatically initializes the memory to zero, making it useful for arrays. realloc() is used to resize memory, and free() deallocates memory.
Add your answer
Loading...

Leave a comment

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