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.
Loading...
Related Quiz
- Failing to release a memory block with ________ before the program terminates can result in a memory leak.
- How can you redirect error messages in a C program to a file instead of displaying them on the console?
-
What is the difference between #include "filename" and #include
in C? - A structure containing an instance of another structure within it is known as a ________ structure.
- The function ______ is used in C to print a string to the standard output.