What is a memory leak? How to avoid it?

Answer Posted / hrpynux@gmail.com

Memory leak occurs when programmers create a memory in heap and forget to delete it. ... To avoid memory leaks, memory allocated on heap should always be freed when no longer needed.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I need a sort of an approximate strcmp routine?

659


What is volatile variable in c with example?

588


Write a program to swap two numbers without using the third variable?

597


What is the hardest programming language?

671


the question is that what you have been doing all these periods (one year gap)

1617






write a program fibonacci series and palindrome program in c

633


Explain what is a stream?

608


What are local variables c?

551


What is declaration and definition in c?

525


Here is a neat trick for checking whether two strings are equal

566


Is it possible to have a function as a parameter in another function?

599


What is sizeof c?

607


What are register variables? What are the advantage of using register variables?

687


what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;

2008


Can you pass an entire structure to functions?

696