哦。。你有没qq加,我再研究研究
别人笑我忒疯癫,我笑别人看不穿;不见五陵豪杰墓,无花无酒锄作田。
#include"iostream.h"
#ifndef _CSTR_H
#define _CSTR_H
class CStr
{
public:
CStr(char *str);
CStr(CStr& c2 );
~CStr();
protected:
private:
char *m_str;
};
CStr::CStr(char *str=NULL)
{
m_str=str;
}
CStr::CStr(CStr& c2 )
{
m_str=c2.m_str;
}
CStr::~CStr()
{
cout<<m_str<<endl;
}
#endif
main()
{ char s[]={"aasdsdfdsf"};
CStr *c1;
c1=new CStr(s);
CStr c2(*c1);
delete c1;
}
这个很完整了....