Question OOP-CTOR-0043
MediumWhat is the output of this code?
#include <iostream>
using namespace std;
class M {
public:
int a, b;
M() : b(5), a(b + 1) {}
};
int main() {
M m;
cout << (m.b == 5);
}
- A.
1
- B.
Compilation error
- C.
Sign up free to see the answer and a step-by-step explanation.