Multiple choice

Which of the following functions is used to release the allocated memory which is no longer required?

  1. dealloc()

  2. delete()

  3. free()

  4. realloc()

  5. clear()

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

When the program closes, operating system automatically releases all the memory allocated by the program but it a good programming practice to release that memory by calling the function free(). The free() function is defined in the header file malloc.h