What is a dangling pointer?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does c++ have arraylist?

744


Where must the declaration of a friend function appear?

737


Why do we use classes in c++?

802


What is the use of main function in c++?

748


Why would you use pointers in c++?

832


What is the difference between an array and a list?

777


Are iterators pointers?

895


Why should we use null or zero in a program?

795


What is array in c++ example?

845


what you know about c++?

863


What is long in c++?

972


. If employee B is the boss of A and C is the boss of B and D is the boss of C and E is the boss of D. Then write a program using the Database such that if an employee name is Asked to Display it also display his bosses with his name. For eg. If C is displayed it should also display D and E with C?

3018


How does com provide language transparency?

788


What is an orthogonal base class in c++?

878


Can a function take variable length arguments, if yes, how?

769