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

What is setiosflags c++?

977


What is data structure in c++?

1148


What are multiple inheritances (virtual inheritance)? What are its advantages and disadvantages?

1057


Explain the static storage classes in c++.

1271


Evaluate as true or false: !(1 &&0 || !1) a) True b) False c) Invalid statement

1186


How do you find out if a linked-list has an end?

1128


What is abstraction in c++ with example?

1135


What are the benefits of pointers?

1038


what does the following statement mean? int (*a)[4]

1078


What is the oldest programming language?

1017


What is the maximum combined length of command line arguments including the space between adjacent arguments?

1000


If a base class declares a function to be virtual, and a derived class does not use the term virtual when overriding that class, is it still virtual when inherited by a third-generation class?

1034


Do you know the problem with overriding functions?

1109


How is computer programming useful in real life?

1065


What is setw manipulator in c++?

1080