Question:Consider the sample code given below and answer the question that follows.
class A
{
public:
A() {}
~A()
{
cout << "in destructor" << endl;
}
};
void main()
{
A a;
a.~A();
}
How many times will "in destructor" be output when the above code is compiled and executed? 

A 0 

B 1 

C 2 

D A compile time error will be generated because destructors cannot be called directly 

+ Answer
+ Report
Total Preview: 861

Copyright © 2024. Powered by Intellect Software Ltd