why we can pass by value or pass by reference and both give the same answers in case when we overload copy assignment operator?
Argument passing issue
Hello @Rj.25,
Can you please elaborate your question.
We pass by value to create a deep copy
and by reference to create a shallow copy.
When we overload copy constructor, it creates a deep copy.
So, any changes made to one object would not be reflected on other.
i.e. changing the data members of one would not change the data members of other.
Hope, this would help.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.