请问这个这个程序结果是40还是37~请求解释~谢了
#include <iostream>using namespace std;
class Test
{
public:
static int x;
Test (int i=0)
{
x=i+x;
}
int Getnum()
{
return Test::x+7;
}
};
int Test::x=30;
void main()
{
Test test;
cout<<test.Getnum()<<endl;
}
2011-06-27 20:33
2011-06-27 23:32
2011-06-27 23:34