🎴 Flashcard Mode

Programming (C/C++)

Card1 / 25
Mastered0
Review0
QuestionClick to flip

With every use of a memory allocation function, what function should be used to release allocated memory which is no longer needed?

AnswerClick to flip back
A
free()
💡 Explanation:

free() is the standard C library function used to release dynamically allocated memory that was obtained using malloc(), calloc(), or realloc(). Every call to a memory allocation function should have a corresponding call to free() to prevent memory leaks.

Change Mode