Answer Posted / hitout
There are different cases to this
1) If the memory is allocated in stack, delete this should
not be called since it calls destructor twice.
2) delete this can be called in all functions except
destructor if the memory is allocated on heap(ie if new
operator is used and the object is not explicitly deleted).
3) Delete this in destructor will always cause an infinite loop.
| Is This Answer Correct ? | 6 Yes | 1 No |
Post New Answer View All Answers
How are Structure passing and returning implemented by the compiler?
How is new() different from malloc()?
What does the linker do?
What are the advantages of using a pointer?
What is algorithm in c++ programming?
Why ctype h is used in c++?
What is java and c++?
Do inline functions improve performance?
What are multiple inheritances (virtual inheritance)?
Is c better than c++?
What does floor mean in c++?
what is c++
How can I learn dev c++ programming?
What is a literal in c++?
Why is c++ difficult?