What is 'Copy Constructor' and when it is called?

Answer Posted / hrpynux@gmail.com

A copy constructor is called when an object is passed by value. Copy constructor itself is a function. So if we pass an argument by value in a copy constructor, a call to copy constructor would be made to call copy constructor which becomes a non-terminating chain of calls.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the uses of typedef in a program?

614


What is the difference between interpreters and compilers?

626


What is the history of c++?

557


What is the difference between *p++ and (*p)++ ?

778


What is pure virtual function?

625






What are friend classes?

612


What is double in c++?

559


What is a unnitialised pointer?

529


Explain object slicing in c++?

585


How can you quickly find the number of elements stored in a static array? Why is it difficult to store linked list in an array?

581


What is an inclusion guard?

617


What are mutator methods in c++?

642


What is the hardest coding language to learn?

601


What does I ++ mean in c++?

583


What is the prototype of printf function?

648