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

what is the difference between north western polytechnique university and your applied colleges?? please give ur answers for this. :)

0 Answers  


What are the advantages of using linked list for tree construction?

0 Answers  


Difference between Function to pointer and pointer to function

0 Answers  


out put of printf(ā€œ%dā€,printf(ram));

5 Answers  


An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above

0 Answers  






what is d pitfalls of registers variables

3 Answers   TCS,


Write the syntax and purpose of a switch statement in C.

0 Answers   Adobe,


macros and function are related in what aspect? a)recursion b)varying no of arguments c)hypochecking d)type declaration

12 Answers   HCL, Infosys, Microsoft,


write a program to display the numbers in the following format 4 4 3 3 3 3 2 2 2 2 2 2 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 2 2 2 2 2 3 3 3 4

9 Answers   IBM, NIIT, Winit,


What is wrong with this code?

0 Answers  


#include<std.h> int main() { char *str[]={"Frogs","Do","Not","Die","They","Croak!"}; printf("%d %d\n",sizeof(str),strlen(str)); ...return 0; } what will the output of the above program?

6 Answers  


What is function prototype in c with example?

0 Answers  


Categories