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
Is sorted c++?
What information can an exception contain?
What is #include c++?
What is the outcome of cout< a) 16 b) 17 c) 16.5
Explain the concept of copy constructor?
Can we delete this pointer in c++?
What is a constructor in c++ with example?
What is an associative container in c++?
Is swift faster than c++?
How the keyword struct is different from the keyword class in c++?
How does com provide language transparency?
Why do you use the namespace feature?
what is Loop function? What are different types of Loops?
What is virtual base class uses?
what is software cycle? What is a mission critical system ? What is the important aspect of a real-time system ? Explain the difference between microkernel and macro kernel. Give an example of microkernel.Why paging is used ? Which is the best page replacement algo and Why ? What is software life cycle ? How much time is spent usually in each phases and why Which one do U want to work if selected in Honeywell ? Which are the different types of testing ? What is a distributed system ? Some questions about CSP. Which languages do U know ? What are the differences between Pascal and C. questions from Compiler construction and Lisp. Which are the different computer architecture? What is the requirement in MIMD ? What is the difference between RISC and CISC processors ? Difference between loosely coupled and tightly coupled systems ? What is an open system?