#include
using namespace std;
class A
{
private:
int n1;
int n2;
public:
A()
{
n2=0;
n1=n2+2;
}//输出结果为:n1:2, n2: 0
A():n2(0),n1(n2+2){}//输出结果为n1:-858993458, n2: 0
//上面这两种方式有啥区别,求指导,为啥结果不一样
void Print(){
cout << "n1:" << n1 << ", n2: " << n2 <<endl;
}
};
int main()
{
A a;
a.Print();
return 1;
}