#include
class B
{
public:
B(); //与类同名,构造函数
B(int i);
~B(); //~析构函数
void Print() const;//const,常量成员,不能修改
private:
int b;
};
B:B()
{
b=0;
cout < < "B 's default constructor called. " <
}
B::B(int i)
{
b=i;
cout < < "B 's constructor called. " <
}
B::~B()
{
cout < < "B 's destructor called. " <
}
void B:Print() const
{
cout <
}