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.
Add your answer
Loading...

Leave a comment

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