You are here:

C++/copy constructor


why do we required to pass a reference to copy constructor?

Srini , Thank you for your question.

The purpose of a copy constructor is to make a copy of a given class instance, specified by a reference to it.

If the class instance were specified directly, the compiler would attempt to make a copy of the given class instance. But that makes no sense, because it is precisely that copy constructor that is being defined.

David Spector


All Answers

Answers by Expert:

Ask Experts


David Spector


Highly knowledgeable in the C++ language, Visual C++ (MSVC), Windows API, documentation and other quality-assurance techniques, and debugging. Knowledgeable in MFC, COM, GUI design, and object-oriented design.


I have been a software engineer since 1965. I have been published. My specializations have been: biomedical programming, compiler implementation, and many kinds of Windows programming. I don't do Databases or other business-oriented stuff.

Windows?/DOS Developer's Journal, ACM SIGPLAN Notices, and Computer Science Press.

ICCP Systems Programming Certification
Master's degree equivalent in Computer Science

©2017 All rights reserved.