全部博文(512)
分类: C/C++
2010-06-13 11:37:00
};
class Test
{
public:
Test();
~Test();
Test(const Test& t);
Test& operator=(const Test& t);
private:
int t1;
public:
ABC m_abc;
};
Test::Test():m_abc(this)
{
cout<<"调用构造函数"<
Test::~Test()
{
cout<<"调用析构函数"<
Test::Test(const Test& t)
{
cout<<"调用复制构造函数"<
Test& Test::operator =(const Test& t)
{
cout<<"调用赋值构造函数"<
return *this;
}
int main()
{
Test t1;
Test t2 = t1;
//Test t3;
//t3 = t1;
return 0;
}