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
What is the difference between C and CPP?
Define namespace in c++?
Can we change the basic meaning of an operator in c++?
What is a linked list in c++?
What does the nocreate and noreplace flag ensure when they are used for opening a file?
What is an iterator class in c++?
How does code-bloating occur in c++?
Are php strings immutable?
What problems might the following macro bring to the application?
How to declare an array of pointers to integer?
Why c++ is faster than java?
what is data encapsulation in C++?
Write a Program to find the largest of 4 no using macros.
What is a c++ object?
Why do we need runtime polymorphism in c++?