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

How do we declare variables in c?

561


What are control structures? What are the different types?

588


In c programming, explain how do you insert quote characters (? And ?) Into the output screen?

758


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

1998


Why doesnt this code work?

611






Difference between constant pointer and pointer to a constant.

607


How arrays can be passed to a user defined function

570


How do you list a file’s date and time?

622


What is main function in c?

543


Why ca not I do something like this?

583


What are structures and unions? State differencves between them.

605


What is a function in c?

567


can any one please explain, how can i access hard disk(physical address)? it is possible by the use of far,near or huge pointer? if yes then please explain......

1400


Write a factorial program using C.

637


What are header files and explain what are its uses in c programming?

603