+1 vote
13 views

1 Answer

+1 vote
by (user.guest)
selected by (user.guest)
 
Best answer

Dangling References: Referring to locations which have been de-allocated.

void main()

{

int *p;

p = dangle(); /* dangling reference */

}

int *dangle();

{

int i=23;

return &i;

}

The problem of dangling references arises, whenever storage is de-allocated. A dangling reference occurs when there is a reference to storage that has been de-allocated. It is a logical error to use dangling references, since the value of de-allocated storage is undefined according to the semantics of most languages. Since that storage may later be allocated to another datum,  mysterious bugs can appear in the programs with dangling references.

Related questions

+1 vote
1 answer
+1 vote
1 answer
+1 vote
1 answer
+1 vote
1 answer
+1 vote
1 answer
+1 vote
1 answer
+1 vote
1 answer
+1 vote
1 answer
+2 votes
1 answer
+1 vote
1 answer
+2 votes
1 answer
+1 vote
1 answer
+1 vote
1 answer
+1 vote
1 answer
+2 votes
2 answers
Welcome to CPEN Talk
Solution-oriented students of computer engineering on one platform to get you that

ONE SOLUTION

...