D
Dhirendra Singh
Hi,
In the below example, does copy constructor has any role in the
initialization ?
class complex {
private:
double re, im;
public:
complex( double r = 0, double i = 0) :re(r), im(i) {}
complex( const complex& c) :re(c.re), im(c.im) {}
};
int main()
{
complex x = complex(3,2);
return 0;
}
In the below example, does copy constructor has any role in the
initialization ?
class complex {
private:
double re, im;
public:
complex( double r = 0, double i = 0) :re(r), im(i) {}
complex( const complex& c) :re(c.re), im(c.im) {}
};
int main()
{
complex x = complex(3,2);
return 0;
}