Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dangling Pointers Explain in C++
#1
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. As the system may reallocate the previously freed memory to another process, if the original program then dereferences the (now) dangling pointer, unpredictable behavior may result, as the memory may now contain completely different data. This is especially the case if the program writes data to memory pointed by a dangling pointer, as silent corruption of unrelated data may result, leading to subtle bugs that can be extremely difficult to find, or cause segmentation faults.

0300-9520262
Get solution in 24 hour
|cpmputer & internetConfusedmileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Explain the difference b/w Null Pointer and Null Nodes? C++ 2012 Vuhelper 0 1,950 01-06-2012, 12:24 AM
Last Post: Vuhelper
  explain this operator -> which is use as headnode->stnext(null); Vuhelper 0 1,723 01-04-2012, 10:26 PM
Last Post: Vuhelper
  What is a Dangling pointer? Briefly explane with example. Vuhelper 0 1,880 11-05-2011, 05:13 PM
Last Post: Vuhelper
  explain error handling in c++ 2011 saneha 0 2,356 05-02-2011, 06:52 PM
Last Post: saneha
  why we use pointers or reference except using real name of var. what is buffer point saneha 1 9,881 05-02-2011, 06:24 PM
Last Post: Vuhelper
  why we use pointers or reference except using real name of var. what is buffer point saneha 1 5,227 05-02-2011, 06:05 PM
Last Post: Vuhelper
  Pointers are not accessible for static member funcion saneha 1 2,299 05-02-2011, 05:48 PM
Last Post: Vuhelper
  Dangling pointer memory leakage Data operations saneha 0 2,499 05-02-2011, 05:43 PM
Last Post: saneha
  why we have declared these two TreeNode pointers left saneha 1 2,162 05-02-2011, 05:15 PM
Last Post: Vuhelper
  explain the copy constructor, shallow copy, and deep copy with examples and c++ code saneha 1 5,439 05-02-2011, 06:45 AM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 1 Guest(s)