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
Why c++ is created?
Can you pass an array to a function in c++?
Can we get the value of ios format flags?
Why is it necessary to use a reference in the argument to the copy constructor?
Why do we use using namespace std in c++?
Tell me can a pure virtual function have an implementation?
What is std namespace in c++?
What is null pointer and void pointer?
What is the difference between public, private, and protected access?
What ANSI C++ function clears the screen a) clrscr() b) clear() c) Its not defined by the ANSI C++ standard
What gives the current position of the put pointer?
What do you mean by early binding?
Explain the advantages of using friend classes.
Write a c program for binary addition of two 8 bit numbers.
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create