Copy constructors
2 posters
Page 1 of 1
Copy constructors
y do we use pass by referance in copy constructors...
can we use pass by value there...
i.e.
the syntax of copy constructor is
class a{
public:
a(a &b){//copy constructor
//body
}
}
y we cant use pass by value here...like a(a b)...????
can we use pass by value there...
i.e.
the syntax of copy constructor is
class a{
public:
a(a &b){//copy constructor
//body
}
}
y we cant use pass by value here...like a(a b)...????
$corpion- Posts : 25
Join date : 2009-01-30
Age : 37
Re: Copy constructors
i am saying just in layman terms...
if suppose u do it by call by value,that itself needs a copy constructor...so it goes on recursively.
it becomes necessary to use reference/pointers to solve this
if suppose u do it by call by value,that itself needs a copy constructor...so it goes on recursively.
it becomes necessary to use reference/pointers to solve this
ramthegreatcv- Posts : 55
Join date : 2009-01-30
Age : 36
Re: Copy constructors
bingooo RamP...
bahi phodu ho to Ramp jaisa...
bahi phodu ho to Ramp jaisa...
$corpion- Posts : 25
Join date : 2009-01-30
Age : 37
Similar topics
» virtual Constructors/Destructors
» Copy On Write
» Copy alink list:Vinisha Ma'am
» copy constructor VS overloaded = operator
» Copy On Write
» Copy alink list:Vinisha Ma'am
» copy constructor VS overloaded = operator
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|