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 are the symptoms of stl?
What is stl in oop?
help me i need a c++ program which takes sequesnce of characters and outputed sequence of their token taypes, work same compiler in lexical analysis phase
What is a stl vector?
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++?
Is stl part of c++ standard?
How do you convert stl to steps?
Is stl open source?
What is stl in c++ with example?
How do I convert a stl file?
i wanted to know about questions about c,c++ , which is required for placements.... im a fresher
What are the components of stl?
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 to making game in c++ ?