C++ output type question

Q.  C++ : Trace the output.

classMyClass
{
public:
~ MyClass( )
{

cout << "MyClass destructor is called" << endl;

}
};

void main( )

{
MyClass s;
s.~MyClass( );
}

- Published on 17 Jun 15

a.
MyClass destructor is called
MyClass destructor is called
b. MyClass destructor is called
c. Compile time error
d. None of the above

ANSWER:
MyClass destructor is called
MyClass destructor is called

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)