11
What will be the output of the program?
#include <iostream>
using namespace std;
class P {
public:
int x;
P(int v) : x(v) {}
P(const P &o) : x(o.x + 1) { cout << "copy "; }
};
int main() {
P a(5);
P b = a;
cout << b.x << endl;
return 0;
}DiscussMedium