sudeephooli
December 14th, 2007, 05:12 AM
Hi All
class test
{
int *i;
public:
test(int n)
{
i = new int(n)
}
test(const test& obj)
{
}
void disp()
{
cout<<*i<<endl;
}
};
Please tell me how to write copy constructor for this class
Thanks
class test
{
int *i;
public:
test(int n)
{
i = new int(n)
}
test(const test& obj)
{
}
void disp()
{
cout<<*i<<endl;
}
};
Please tell me how to write copy constructor for this class
Thanks