Question OOP-CTOR-0018
HardWhat is the output of this code?
#include <iostream>
using namespace std;
struct M { M(int v) { cout << v << " "; } };
struct S {
M a, b, c;
S() : c(3), b(2), a(1) {}
};
int main() {
S s;
return 0;
}
- A.
3 2 1
- B.
1 3 2
- C.
Sign up free to see the answer and a step-by-step explanation.