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
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 the use of stl?
What is stl in oop?
What two types of containers does the stl provide?
How connect plc and pc through software
Is there any error below, its a code to delete all entires from a map #include
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
please visit this site you'll find my question this is my homework please answer it if you can http://easyscience.org/ib/lofiversion/index.php/t36168.html
What are stl algorithms?
What is stl language?
What are the various types of stl containers?
Describe the My Computer and My Documents folders; identify the elements that are present in every Window.
Is stl part of c++ standard?
How is stl different from c++ standard library?
how to use C++?