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
give me an example for testing a program showing the test path .show how the test is important and complex.
What is a dynamic binding in c++?
Arrange Doubly linked list in the ascending order of its integral value and replace integer 5 with 7?
Why do we use pointers in c++?
What is class in c++ with example?
What are iterators in c++?
What are the comments in c++?
If dog is a friend of boy, is boy a friend of dog?
What do the keywords volatile and mean mutable?
How would you find out if a linked-list is a cycle or not?
Explain the isa and hasa class relationships. How would you implement each?
What is the difference between an enumeration and a set of pre-processor # defines?
What is the main purpose of c++?
Write a struct time where integer m, h, s are its members?
Explain operator overloading.