#include<stdio.h>
class Object
{
public:
int a;
int b;
public:
Object(int a,int b)
{
this->a = a;
this->b = b;
}
Object(const Object& other)
{
this->a = other.a;
this->b = other.b;
printf("in copy constructor...\n");
}
};
void test(Object obj)
{
}
int main() {
Object obja(1, 2);
Object objb(obja);
printf("%d", objb.a);
Object* p = new Object(obja);
delete p;
test(obja); //以上三种方法实现拷贝构造函数
}