Question OOP-CTOR-0037
EasyWhat is the output of this code?
#include <iostream>
using namespace std;
struct S {
S() { cout << "C"; }
~S() { cout << "D"; }
};
int main() {
cout << "1";
{
S s;
cout << "2";
}
cout << "3";
}
- A.
12C3D
- B.
1C23D
- C.
Sign up free to see the answer and a step-by-step explanation.