Copy Constructor arguments

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.

When is copy constructor called ?

 

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 writeulearn@gmail.com 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.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.