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

【新手乐园】C++ 析构函数输出解决方法

2012-04-27 
【新手乐园】C++ 析构函数输出#include iostream#include stringusing namespace stdclass Cat{public:

【新手乐园】C++ 析构函数输出
#include <iostream>
#include <string>
using namespace std;
class Cat
{
public:
string name;
Cat(string na)
{name = na;
cout<<"new cat name: "<<name<<endl;
}
~Cat()
{cout<<"delete cat: "<<name<<endl;}
};

int main() 
{
Cat c1("Kitty"),c2("Marry"); 
return 0;
}


[解决办法]
楼主问的是什么?

热点排行
Bad Request.