#include <iostream>
using namespace std;
class test
{
public:
test(int param)
{
i=param;
}
test(test &obj)
{
i=obj.i;
}
~test()
{
cout << "~test()" << endl;
}
private:
int i;
};
void func1(test obj)
{
cout << "func1()" << endl;
}
void func2(test &obj)
{
cout << "func2()" << endl;
}
int main()
{
test a(1);
test b(2);
test c(3);
func1(a);
func2(b);
return 0;
}
Login in to like
Login in to comment