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
C is to C++ as 1 is to a) What the heck b) 2 c) 10
What is srand c++?
What is a static member?
Explain virtual class and friend class.
Where the memory to the static variables is allocated?
What is the average salary of a c++ programmer?
What you know about structures in C++?
Please explain the reference variable in c++?
What is the difference between the compiler and the preprocessor?
What is increment operator in c++?
What are the benefits of operator overloading?
What is the best c++ ide?
Difference between a homogeneous and a heterogeneous container
What is general form of pure virtual function? Explain?
What is algorithm in c++ programming?