To resize a previously allocated memory block, the function ________ is used in C.

  • calloc()
  • free()
  • malloc()
  • realloc()
To resize a previously allocated memory block in C, the function realloc() is used. It allows you to change the size of the memory block while preserving the existing data. malloc() and calloc() are used for initial memory allocation, and free() deallocates memory.
Add your answer
Loading...

Leave a comment

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