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 / hemant

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 ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between C and CPP?

1167


Define namespace in c++?

1055


Can we change the basic meaning of an operator in c++?

1114


What is a linked list in c++?

1050


What does the nocreate and noreplace flag ensure when they are used for opening a file?

1119


What is an iterator class in c++?

1141


How does code-bloating occur in c++?

1207


Are php strings immutable?

1061


What problems might the following macro bring to the application?

1057


How to declare an array of pointers to integer?

1146


Why c++ is faster than java?

1064


what is data encapsulation in C++?

1073


Write a Program to find the largest of 4 no using macros.

1083


What is a c++ object?

1180


Why do we need runtime polymorphism in c++?

1027