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

What are the three main types of variables?

850


Why do we need polymorphism in c#?

906


Describe these concepts: Polymorphism, Inheritance and Abstraction.

904


What is the types of inheritance?

840


What is destructor in oop?

815


write knight tour problem which is present in datastructure

2403


What is oops and its features?

855


Can you inherit a private class?

871


When not to use object oriented programming?

800


What is stream in oop?

1063


What does <> mean pseudocode?

873


What is use of overloading?

883


What are the 3 pillars of oop?

898


Why oops is important?

813


What is meant by oops concept?

814