What function is used in C to allocate a block of memory for an array of elements, initialize them to zero, and then return a pointer to the memory?

  • alloc
  • calloc
  • malloc
  • realloc
The calloc function in C is used to allocate a block of memory for an array of elements, initializes them to zero, and returns a pointer to the memory. It is especially useful for dynamic memory allocation.
Add your answer
Loading...

Leave a comment

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