Question OOP-CTOR-0016
HardWhat is the output of this code?
#include <iostream>
using namespace std;
struct B {
B() {}
B(const B&) { cout << "Copy"; }
B& operator=(const B&) { cout << "Assign"; return *this; }
};
int main() {
B a, b;
b = a;
return 0;
}
- A.
Nothing
- B.
Assign
- C.
Sign up free to see the answer and a step-by-step explanation.