GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Tech FAQs  >  OOPS

 Print  |  
Question:   What will happen if I say delete this



November 11, 2005 05:11:33 #2
 somaraj   Member Since: Visitor    Total Comments: N/A 

RE: What will happen if I say delete this
 

The most important point is , The way in which the object is created .

If the object is created on stack - the object will be destroyed twice resulting in crash . First time when delete this is called second time when the stack unwinds.

But if the object is created in heap - delete this may work but that should be the last line using the object.

     

 

Back To Question