Question OOP-CTOR-0042
MediumWhat is the output of this code?
#include <iostream>
using namespace std;
class A {
public:
A() { cout << "D "; }
A(const A &) { cout << "C "; }
};
void f(A x) {}
int main() {
A a;
f(a);
A b = a;
}
- A.
D C C
- B.
D C
- C.
Sign up free to see the answer and a step-by-step explanation.