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
What is stl stand for?
i wanted to know about questions about c,c++ , which is required for placements.... im a fresher
how to making game in c++ ?
write a program to convert a decimal number in to its equivalent binary number?
What is a standard template library (stl)? What are the various types of stl containers?
how can u do connectivity in c++ language? plz send me connectivity code in c++ ?
Name the different types of stl containers.
totoo po ba ang manga aliens!
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.
What is meant by stl in c++?
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 do stl stand for?
In what scenario does the Logical file and Physical file being used?
What are the different types of stl containers?
Describe how to safeguard a system through acquisition of an antivirus Program and systematic backup.