What are dangling pointers,virtual constructors and virtual destructors?

Questions by disha

Showing Answers 1 - 2 of 2 Answers

samir kumar tripathy

  • Dec 7th, 2005
 

char *str=new str;char *str1=new str1;strcpy(str,str1);delete str;at this time str will act as dangling pointer because when str1 is copied to str ,then it will create the deep copy,so when when we will delete that one then still thare is existing of its instance.That is called dangling pointer

  Was this answer useful?  Yes

Tanusree Bhattacharjee

  • Dec 22nd, 2005
 

HI, if free is used to free a pointer it does not actually gets freed and hence called dangling pointer

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions