Answer Posted / sandip
To avoid local copy of object reference (&) is used in copy
constructor.
Moreover if the & is ommited then copy constructor goes in
infinite loop.
eg. if class name is Sample.
Copy constructor without &
Sample :: Sample (Sample s)
{
//Code goes here
}
and we create object as follows. ;
Sample s;
Sample s1(s);
In this scenario program will go in infinite loop.
Is This Answer Correct ? | 9 Yes | 1 No |
Post New Answer View All Answers
To modify an, existing worksheet. What steps are involved for: 1. Inserting and deleting rows and columns. 2. Printing cell formulas 3Jld displayed values 3. Using the page setup command
What is a stl vector?
Describe how to safeguard a system through acquisition of an antivirus Program and systematic backup.
Do you like to Submit Questions in Bulk under Same Category?? Then use our Bulk ListerDo you like to Submit Questions in Bulk under Same Category?? Then use our Bulk Lister
how can u do connectivity in c++ language? plz send me connectivity code in c++ ?
how to use C++?
In what scenario does the Logical file and Physical file being used?
Is string part of stl?
Can we use stl in coding interviews?
Who wrote stl?
What is stl stack?
Why should a c++ programmer be interested in stl?
what is template and type convertion
What is meant by stl in c++?
Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.