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



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

Answer / 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

More C++ General Interview Questions

int main() { int i ,a[i]; i = 0; a[i] = 10; cout<< a[i] << endl; return 0; } What will be output of this program?

11 Answers   HCL, Mphasis,


There are 100 students in a class. The management keep information in two tables. Those two tables are given like Roll no Name Age 001 ABC 15 002 XYZ 14 and Roll No Subject Marks 001 Math 75 001 Physics 55 002 Math 68 001 Hindi 69 They want the information like this Roll No Name Hindi Physics Math Total 001 ABC 69 55 75 199 002 XYZ 68 74 84 226 And Roll No Suject Highest 001 Math 98 007 Physics 84 021 Hindi 74 All 275 All information is kept in structure in main memory. You have to find last two tables.

0 Answers  


What are the four partitions in which c++ compiler divides the ram?

0 Answers  


Of the numbers 12 23 9 28 which would be at the top of a properly implemented maxheap a) 28 b) 9 c) Any of them could be

0 Answers  


Is c++ still in demand?

0 Answers  


What is virtual base class uses?

0 Answers  


What is microsoft c++ redistributable?

0 Answers  


What is the use of ‘using’ declaration?

1 Answers  


What is runtime errors c++?

0 Answers  


What is #include sstream?

0 Answers  


What is algorithm in c++ programming?

0 Answers  


Give the difference between the type casting and automatic type conversion. Also tell a suitable C++ code to illustrate both.

0 Answers   TCS,


Categories