What is the primary cause of memory leaks in a C program?

  • Excessive memory fragmentation.
  • Failure to free dynamically allocated memory.
  • Incorrect use of the malloc function.
  • Insufficient memory allocation.
The primary cause of memory leaks in a C program is the failure to free dynamically allocated memory using functions like free(). When you allocate memory but don't deallocate it properly, it leads to memory leaks.
Add your answer
Loading...

Leave a comment

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