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
Does c++ support exception handling?
Is there finally in c++?
What is fixed in c++?
What is private, public and protected inheritance?
What is lvalue?
What is the full form of india?
What is function overloading c++?
Differentiate between late binding and early binding. What are the advantages of early binding?
Write some differences between an external iterator and an internal iterator?
Explain shallow copy?
How to implement is-a and has-a class relationships?
What is a multiset c++?
What are vtable and vptr?
What is object in c++ wikipedia?
What is the advantage of an external iterator.