填空题
下列程序的运行结果是______。
#include<iostream.h>
class test
{
private:
int hum;
public:
test( );
int TEST( ){return num+100;)
~test( );
};
test::test( ){num=0;)
test::~test( ){cout<<"Destructor is active"<<endl;)
void main( )
{
test x[3];
cout<<x[1].TEST( )<<endl;
}
【正确答案】
1、100
【答案解析】Destructor is active
Destructor is active
Destructor is active
[解析] 本题比较简单,考查考生基本的类的定义,构造函数以及对象数组的概念。