What happens when we make call "delete this;" ?? ,Java, C ,C++, ASP, ASP.net C# ,Struts ,Questions & Answer, Struts2, Ajax, Hibernate, Swing ,JSP , Servlet, J2EE ,Core Java ,Stping, VC++, HTML, DHTML, JAVASCRIPT, VB ,CSS, interview ,questions, and answers, for,experienced, and fresher
What happens when we make call "delete this;" ??

When we call "delete this" then two cases are generate in the code . First, if it executes in a member function for an extern, static, or automatic object, the program will probably crash as soon as the delete statement executes. There is no portable way for an object to tell that it was instantiated on the heap, so the class cannot assert that its object is properly instantiated. 

Second, when an object commits suicide this way, the using program might not know about its demise. As far as acc to the instantiating programme, the object remains in scope and continues to exist even though the object did itself in. Subsequent dereferencing of the pointer can and usually does lead to disaster.

More interview questions and answers
What is the use of tellp ()?
What is the use of tellg ()?
whats the use of seekp() and seekg()?
What is the use of file pointers?
What are the types of file pointers?and whats the uses of the file pointers?
What are the types of file pointers?nad whats the use?
What does the file mode parameter ios::binary mean?
What is the difference between ios::ate and ios::app mode?
In which class is the function eof () present?
Give examples for synchronous exceptions?
What are storage qualifiers in C++ ?
What is EOF?
What are manipulators?
What is a file?
What is the use of exception handling?
What is the use of using?
What is the use of template classes and functions?
What are the ways of opening a file?
What are the parts of a file name?
What is the limitation of �cin�?
What are stream classes?
What is a stream? and define the types of Stream?
What is callback function?
What are �do-nothing� functions?
What are abstract base classes?
What are C-strings or C-style strings?
What is run time polymorphism?
What are pointer constants?
What are pointer variables?
What is overriding?
What is containership?
How to reverse a string using a recursive function, with swapping?
How are prefix and postfix versions of operator++() differentiated?
I want to have a program to read a string and print the frequency of each character and it should work in turbo c
Write a function for strtok()?
What is �*� operator called as?
give me a any two main roles of Operating System?
What is the difference between char *a and char a[]?
Give us List out some of the OODBMS available?
What is the difference b/w const char *myPointer and char *const myPointer?
What is copy constructor?
When are copy constructors called?
What is a memory leak?
What is conversion constructor?
What is conversion operator??
What is the type of conversion operator?
What is difference b/w huge & far & near pointer?
What are the access privileges in C++? What is the default access level?
What does extern "C" int func(int *, Foo) accomplish?
What happens when we make call "delete this;" ??
What is the difference between system call and library function?
What are C++ storage classes?
Whar is the Auto storage class in C ?
What is the Auto Storage Class?
What are the Register Storage class?
What are the Static Storage class?
What are the Extern Storage class?
What is difference between template and macro??
What is constructor or ctor?
How to convert an char array to decimal array?
How can a base pointer access the members of a derived class?
How to fill a rectangle using window scrolling in C?
What are 2 ways of exporting a function from a DLL?
Explain about storage of union elements.
What do you mean by binding of data and functions?
How to differentiate while and do while statement?
What is a scope resolution operator?
What are the conditions that have to be met for a condition to be an invariant of the class?
What is the difference between an ARRAY and a LIST?
What is a node class?
Define a constructor - What it is and how it might be called (2 methods).
How can you tell what shell you are running on UNIX system?
How to convert a string into integer?
Can you think of a situation where your program would crash without reaching the breakpoint which you set at the beginning of main()?
How to print our name without using semicolon in c?
How to print value of integers into words?
Why are arrays usually processed with for loop?
What will be the output of x++ + ++x?
What is friend function?
what are header files?Can i run program without using header file?
What is abstraction?
What is macro?
What�s the auto keyword good for?
What is the difference between an external iterator and an internal iterator? Describe an advantage of an external iterator.
How multiplication take place upto 200 digits?
How to differentiate i++* and *++i?
What is the difference between getch() and getchar()?
Write a program crashed before reaching main? If happen, how?
What is a mutable member?
What are the problems with a tree-style hierarchy?
Write a program for 1 232 34543 4567654?
Why is iostream better than stdio?
What does exit() do?
When would you use private inheritance?
What is the difference between memcpy and strcpy?
What's the difference between a struct and a class?
How can we handle exceptions in C?
How to compare two strings without using the strcmp() function?
How to access or modify the constt variable in C ?
What is an volatile variable?