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 15a.
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