代码随便写的.呵呵..
#include<iostream>
using namespace std;
class A
{
int a,b;
public:
A(){}; //default constructor
A(int aa,int bb):a(aa),b(bb){} //constructor
A(A& aa) //copy constructor
{
a = aa.a,b = aa.b;
}
void display(){cout<<"a="<<a<<",b="<<b<<endl;}
};
int main(void)
{
A Obj1; //invoke A()
A Obj2(2,3); //invoke A(int,int)
A Obj3(Obj2); //invoke A(A&)
Obj1.display(),Obj2.display(),Obj3.display();
system("pause");
return 0;
}