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.
Wednesday, June 21, 2006
Subscribe to:
Post Comments (Atom)

2 comments:
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.
new calls operator new to alloc the required memory and then calls the constructor.
delete calls the destrutor and then calls the corresponding operator delete.
Post a Comment