int main()
{
myClass obj;
.... /* doing things */
....
delete &obj; /* illegal */
}
Lets assume myClass is a proper C++ class with everything in place. Now, I know this is illegal and this program will crash in runtime. Fist thing is that code is trying to delete a stack object and then again after the scope finishes it will be destoryed once again. I want to know the internals of this illegal operation. i.e. what will happen with delete, will it call the destructor? It may look like crazy to you but please help me to understand.