What is dangling pointers?and what is memory leak?
Answer Posted / prakash
dangling pointer : Dangling pointers in computer
programming are pointers that do not point to a valid
object of the appropriate type. Dangling pointers arise
when an object is deleted or deallocated, without modifying
the value of the pointer, so that the pointer still points
to the memory location of the deallocated memory.
memory leak:A memory leak in computer science is a
particular type of unintentional memory consumption by a
computer program where the program fails to release memory
when no longer needed.
ex:
void f(void)
{
void* s;
s = malloc(50); /* get memory */
return;
}
//control comes out w/o freeing the memory....
| Is This Answer Correct ? | 70 Yes | 13 No |
Post New Answer View All Answers
Tell me what are static member functions?
What is #include cstdlib in c++?
What is data types c++?
Why do we use structure in c++?
Is eclipse good for c++?
What is an undefined reference/unresolved external symbol error and how do I fix it?
What is the difference between method overloading and method overriding in c++?
What is a class definition?
What is the purpose of template?
Define copy constructor.
Write a struct time where integer m, h, s are its members?
Please explain the reference variable in c++?
Can we change the basic meaning of an operator in c++?
What does int * mean in c++?
How would you call C functions from C++ and vice versa?