0
Can any one explain what is copy constructor?
I tried but i am not getting how it works...
2 Respostas
+ 3
A constructor which takes an object of it's own class as an argument to initialize a new object, is a copy constructor. E.g.
class A {
//...
};
int main() {
A obj;
// some operations with obj
A obj2(obj);
// obj2 initialized using obj
}
0
Ok.. Thanks Hasty for answering my question..