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

How many namespaces are there in c++?

796


What is constructor in C++?

854


What does namespace mean in c++?

850


Which function cannot be overloaded c++?

850


What is an inline function in c++?

881


Define Virtual function in C++.

862


Can a class be static in c++?

841


Const char *p , char const *p What is the difference between the above two?

967


What is #include cmath?

860


what are the characteristics of Class Members in C++?

842


What is pointer with example?

758


What is expression parser in c++

2165


Is map ordered c++?

851


What does it mean to declare a member function as static?

843


What does std :: flush do?

901