When using dynamic memory allocation for arrays, which standard library function is used to release the memory that was previously reserved?
- calloc
- free
- malloc
- realloc
The correct function to release dynamically allocated memory is free. It is used to deallocate the memory previously reserved using malloc or calloc.
Loading...
Related Quiz
- When reading a file in C, which function can be used to check if the end of the file has been reached?
- Which preprocessor directive would be used to conditionally compile certain blocks of code?
- You're working on an application that processes large datasets. Why might you choose to use pointers to arrays instead of traditional arrays?
- In C, what happens if you attempt to open a file for reading using fopen() but the file does not exist?
- In optimizing a recursive algorithm for calculating Fibonacci numbers, what concept can be applied to avoid redundant calculations?