Test your C++ knowledge...# Programming - 葵花宝典
a*n
1 楼
I am reading a book, notice this.
Do you know why including the commented lines (5th or/and 8th lines) will throw
compile error? Please answer it without trying on the machine.
/////////////////////////////////////////////////////////
class X {
private:
double m;
static double n;
//X member1; // Will give compile error, do you know why?
static X member2;
public:
//X(double d = m); // will give compile error, do you know why?
X(int, double d = n
Do you know why including the commented lines (5th or/and 8th lines) will throw
compile error? Please answer it without trying on the machine.
/////////////////////////////////////////////////////////
class X {
private:
double m;
static double n;
//X member1; // Will give compile error, do you know why?
static X member2;
public:
//X(double d = m); // will give compile error, do you know why?
X(int, double d = n