What happens when realloc is called with a size parameter of zero?

  • It frees the previously allocated memory.
  • It leads to a memory leak.
  • It reallocates the memory with a size of zero.
  • It returns a null pointer.
When realloc is called with a size parameter of zero, it frees the previously allocated memory and returns a pointer to the freed memory, effectively deallocating it.
Add your answer
Loading...

Leave a comment

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