Chapter 14: Problem 10
Why must the parameter of a copy constructor be a reference?
Short Answer
Expert verified
Answer: The parameter of a copy constructor must be a reference because if it were not, we would have to pass the object by value. Passing an object by value would require creating a copy of the object, which would call the copy constructor. This would lead to an infinite loop of calling the copy constructor and creating more copies. By using a reference, we avoid this infinite loop as a reference does not create a new object, but rather refers to the memory location of the existing object.