What is a dangling pointer?

Answers were Sorted based on User's Feedback



What is a dangling pointer?..

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

What is a dangling pointer?..

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

What is a dangling pointer?..

Answer / vemana palleboina

Blocked memory.

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More C++ General Interview Questions

what are difference between c and c++?

9 Answers   Accenture,


Can we make copy constructor private in c++?

0 Answers  


What is a volatile variable in c++?

0 Answers  


why we cant create array of refrences

4 Answers  


Carry out conversion of one object of user-defined type to another?

0 Answers  






What is the main use of c++?

0 Answers  


What is the standard template library (stl)?

0 Answers  


What is a wchar_t in c++?

0 Answers  


Is swift better than c++?

0 Answers  


What is iterator c++?

0 Answers  


What are the general quetions are in DEna bank manager IT/System interviews?

0 Answers   Dena Bank, ICICI,


When to use Multiple Inheritance?

6 Answers  


Categories