What is a memory leak? How to avoid it?



What is a memory leak? How to avoid it?..

Answer / 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

More C Interview Questions

Explain how can a program be made to print the name of a source file where an error occurs?

0 Answers  


What are the 5 elements of structure?

0 Answers  


Can a local variable be volatile in c?

0 Answers  


What is the use of ?: Operator?

0 Answers  


write a program in 'c' to find the value of p[i+1]^n.p,i,n are arguments of a macro and n is a integer

1 Answers  






write a c program to add two integer numbers without using arithmetic operator +

13 Answers   Value Labs,


Write a c program to read a positive number and display it in words.? ex: 123=one two three help me....

2 Answers  


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......

0 Answers  


What are global variables?

0 Answers  


Explain how can you tell whether a program was compiled using c versus c++?

0 Answers  


What is %g in c?

0 Answers  


do ne body have any idea about the salary for the we r going to have interview. yup .. u got it right ..i m talking abt NIC.

1 Answers  


Categories