//Ex6_6_1.cpp
#include "iostream" 
#include "cstring" 
using namespace std;
class Person
{private:
   char name[20];
   char sex;
   int age; 
 public:
   Person()   //构造函数
	{strcpy(name,"XXX");
     age=0;
     sex='m';}
   ~Person()   //析构函数
	{cout<<name<<":"<<sex<<","<<age<<endl;}
   void set(char *n,char s,int a)
	{strcpy(name,n);
     sex=s;
     age=a;}
};
void main()
{Person p;
 p.~Person();   //调用析构函数实现输出
 p.set("WangHong",'m',20);   //调用类的成员函数
} 
