When is it appropriate to use the free function in C programming?
- After allocating memory using malloc
- At the beginning of your program
- When you are done using dynamically allocated memory
- Whenever you want
The free function in C is used to deallocate the dynamically allocated memory when you are done using it. It helps prevent memory leaks and frees up resources.
Loading...
Related Quiz
- The ________ directive can be used in C to include a file only once in a program.
- When an array is passed to a function, it is actually passing the ________ of the first element.
- An enumeration is a user-defined data type that consists of integral ________.
- The ________ loop guarantees at least one execution of the loop body, even if the condition is false from the start.
- Which keyword is used in C to create an alias for a data type?