English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

suppose two objects obj1 and obj2 both are created from same class.
I can directly equate both objects obj1 = obj2.
What is the need for Copy Constructor?

2006-09-17 20:15:31 · 3 answers · asked by crsreenu 1 in Computers & Internet Programming & Design

3 answers

Most times an assignment operator would simply be an alias for copy constructor, but that doesn't make them unnecessary. The lesson of the copy constructor goes towards factoring code properly. Other methods and overloaded operators might require that copy constructor depending on your design requirements.

2006-09-17 21:21:07 · answer #1 · answered by John T 3 · 0 0

Copy constructor is the guy behind making direct assignment work for C++ assuming we are not throwing some pointers to the mix..

2006-09-17 20:26:17 · answer #2 · answered by Andy T 7 · 0 0

A "Messianic Jew" is someone believes in and follows Jesus Christ as the promised messiah, and at the same time strongly identifies with Judaism and Hebraic cultural practices (which for the most part do not accept Jesus as a messianic figure). A "Christian" is any other believer/ follower of Jesus, one with little or no Jewish background.

2016-03-27 06:47:33 · answer #3 · answered by Anonymous · 0 0

fedest.com, questions and answers