24 lines
353 B
C++
24 lines
353 B
C++
|
// 如下程序运行的结果是什么 ? 是否存在错误,如果有错请指出并分析原因。
|
||
|
#include <iostream>
|
||
|
|
||
|
using namespace std;
|
||
|
|
||
|
class Abc
|
||
|
{
|
||
|
private:
|
||
|
int rN;
|
||
|
|
||
|
public:
|
||
|
Abc(int x) : rN(x) {}
|
||
|
static void print()
|
||
|
{
|
||
|
Abc abc(20);
|
||
|
cout << abc.rN << endl;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
int main()
|
||
|
{
|
||
|
Abc::print();
|
||
|
return 0;
|
||
|
}
|