#include <
iostream>
using
namespace std;
class Internet
{
public:
Internet(
char *name,
char *address)
{
cout<<"载入构造函数"<<endl;
strcpy(Internet::name,name);
}
Internet(Internet &temp)
{
cout<<"载入COPY构造函数"<<endl;
strcpy(Internet::name,temp.name);
cin.get();
}
~Internet()
{
cout<<"载入析构函数!";
}
public:
char name[20];
char address[20];
};
void
main()
{
Internet &a=Internet("中国软件开发实验室","www.cndev-lab.com");
cout<<a.name;
cin.get();
}
转载于:https://www.cnblogs.com/davidlili/archive/2006/09/11/500552.html