首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

请大家帮忙看个小程序,该怎么解决

2012-03-18 
请大家帮忙看个小程序#includeiostream.hclassBase{public:virtual~Base(){cout ~Base endl}}

请大家帮忙看个小程序
#include   <iostream.h>
class   Base
{
public:
virtual   ~Base()   {   cout < <   "~Base "   < <   endl   ;   }
};
class   Derived   :   public   Base
{
public:
virtual   ~Derived()   {   cout < <   "~Derived "   < <   endl   ;   }
};
void   main(void)
{
Base   *   pB   =   new   Derived;   //   这句是什么意思?
delete   pB;
}

--------------------------


[解决办法]
那就再认真读几遍吧,记得多做书上的习题。
熟能生巧,没有其它捷径的。

热点排行