What is a dangling pointer?
Answers were Sorted based on User's Feedback
Answer / sumithra.a
A dangling pointer arises when you use the address of an
object after its lifetime is over. This may occur in
situations like returning addresses of the automatic
variables from a function or using the address of the
memory block after it is freed
| Is This Answer Correct ? | 16 Yes | 0 No |
Answer / achal ubbott
Here is an example of dangling pointer.
char* p = new char;// allocate a byte from heap section.
delete p ; // deallocation.
*p = 44 ; // using a dangling pointer.
| Is This Answer Correct ? | 8 Yes | 0 No |
Specify some guidelines that should be followed while overloading operators?
What are Binay tress and B trees? Diff between them?
How is c++ used in the real world?
When one must use recursion function? Mention what happens when recursion functions are declared inline?
write a program to insert an element into an array
What is data abstraction? How is it different from data encapsulation?
Check for Balanced Parentheses using Stack?
What is this pointer in c++?
Is java easier than c++?
Is there finally in c++?
Why do we use vector in c++?
How do you remove an element from a set in c++?