What is importance of const. pointer in copy constructor?
the reason for constant is that in copy constructor u never need to change the value of the passed object so to avoid accidental change it is passed as a constant
Why Call by Reference :
Think of what happens if it’s not a reference. The object gets passed as a copy. But to get passed as a copy, the copy constructor would be
called. That copy constructor gets its value by copy, so the copy
constructor must be called, for which the copy constructor would need to be called, which needs….
This will result in an infinite loop.
Resolving technical problems:
Solve your technical problems instantly
We provide Remote Technical Support from Monday to Sunday, 7:00PM to 1:00 AM
Mail your problem details at firstname.lastname@example.org along with your mobile numberand we will give you a call for further details. We usually attend your problems within 60 minutes and solve it in maximum 2 days.