下面程序的结果是   #include<iostream.h>   class test{ private:         int num;       public:        test( );        int getint( ) {ret

admin2013-02-27  31

问题 下面程序的结果是   #include<iostream.h>   class test{  private:         int num;       public:        test( );        int getint( ) {return num;}        ~test( );};   test::test( )   {  num=0;}   test::~test( )   {  cout<<"Destructor is active"<<endl;}   void

选项 A、Exiting main  Destructor is active  Destructor is active  Destructor is active
B、Exiting main  Destructor is active  Destructoris active
C、Exiting main  Destructoris active
D、Exiting main

答案1

解析 C++语言中析构函数是在程序退出不用该类的对象时进行调用。
转载请注明原文地址:https://kaotiyun.com/show/9ENp777K
0

最新回复(0)