why the argument is passed by reference to a copy
constructor?example?

Answer Posted / vishwa

we are creating a copy of the data , so it is better to get
the data directly from the original object, reference
mechanism provides us above. so we use the reference object
and also to restrict the change to original object we also
pass the reference as const.

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why oops is important?

607


what are the realtime excercises in C++?

2333


What is overloading and its types?

612


what are the ways in which a constructors can be called?

1581


what is the drawback of classical methods in oops?

2918






What is ambiguity in inheritance?

625


what are the different types of qualifier in java?

1840


If a=5, b=6, c=7, b+=a%c*2. What is the final value of b?

942


Is react oop?

607


What is object in oop?

679


What are functions in oop?

582


Can enum be null?

585


What is polymorphism in oops with example?

527


What are the three parts of a simple empty class?

1458


What is the renewal class?

2162