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

Can bst contain duplicates?

945


What is abstraction in oop with example?

857


Is data hiding and abstraction same?

773


Is html an oop?

783


Can enum be null?

768


What is multilevel inheritance explain with example?

870


How do you use inheritance in unity?

802


What is multilevel inheritance?

954


Will I be able to get a picture in D drive to the c++ program? If so, help me out?

1875


How Do you Code Composition and Aggregation in C++ ?

24717


What is protected in oop?

811


What is polymorphism used for?

773


which feature are not hold visual basic of oop?

1943


What is object in oop?

879


What is methods in oop?

745