#include
class X {
public:
X() {}
X(int j):n(j) {}
X(const X& rhs) { this->n = rhs.n+1; }
private:
int n;
};
int main()
{
X x1;
X x2(x1);
return 0;
}
Referring to the sample code above, what is the value of "x2.n"?
a) 0
b) 1
c) The value cannot be determined.
E*U 发帖数: 2028
2
c
【在 c**********e 的大作中提到】 : #include : class X { : public: : X() {} : X(int j):n(j) {} : X(const X& rhs) { this->n = rhs.n+1; } : private: : int n; : }; : int main()