#include "iostream.h"
#include "string.h"
class base
{
public:
base( const char *p)
{
strcpy(t,p);
cout<<p<<" base Constructed! "<<endl;
}
~base()
{
cout<<t<<" base Deconstruct! "<<endl;
}
void get()
{
cout<<"base t:"<<t<<endl;
cout<<"base w:"<<w<<endl;
}
private :
static int w;
char t[20];
};
int base::w=23; //静态成员必须被初始化(在类外)
void main()
{
base k("Object K ");
k.get();
}