Wednesday, June 21, 2006

Calling delete this in the destructor

When you call delete this in the destructor of the coressponding class it goes into an recursion and an stack overflow hapens .

RULE:-
new :- calls the constructor
delete :- calls the destructor .
malloc,calloc, realloc :- nothing hapens only alloacation hapens
replacement new :- has to be used to call the coresponding constructor of the class allocated through malloc.

1 comment:

catherine said...

Da...want some help in hacking in to her machine. Plz explain the steps to me as if i were a 5 year old kid who is preparing to fly a chopper. But ofcouse i want clean results. I want her d'n on her knees.