Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What will happen if when say delete this ?

Answer Posted / mms zubeir

There are two scenarios:

1. Using "delete this;" in destructor

Here the call will be a recursive call to the destructor
infinitely. So the program hangs here.

2. Using "delete this;" in other members of a class
including constructor.

In this case, the call is a sucide call since the object
tries to delete itself which is nothing but sitting in a
space and destroy that space itself. That is definitely a
memory crash.

Is This Answer Correct ?    13 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

C is to C++ as 1 is to a) What the heck b) 2 c) 10

1109


What is srand c++?

1171


What is a static member?

1089


Explain virtual class and friend class.

1097


Where the memory to the static variables is allocated?

1103


What is the average salary of a c++ programmer?

1063


What you know about structures in C++?

1138


Please explain the reference variable in c++?

1127


What is the difference between the compiler and the preprocessor?

1165


What is increment operator in c++?

1056


What are the benefits of operator overloading?

1269


What is the best c++ ide?

1233


Difference between a homogeneous and a heterogeneous container

1197


What is general form of pure virtual function? Explain?

1036


What is algorithm in c++ programming?

1183