Answer Posted / namitha
A copy constructor is used in the following cases.
-When an object is created from another object of the same
type.
-When an object is passed by value as a parameter to a
function.
-When an object is returned from a pointer.
-when we want to set a default value for the data members.
Is This Answer Correct ? | 4 Yes | 3 No |
Post New Answer View All Answers
When should you use global variables?
Explain explicit container.
How do you print a string on the printer?
What is c++ best used for?
What is a manipulative person?
How does the copy constructor differ from the assignment operator (=)?
What does return 0 do in c++?
What is runtime errors c++?
When should we use container classes instead of arrays?
What is the use of :: operator in c++?
What is an adjust field format flag?
What is a static element?
What are structs in c++?
What does 7/9*9 equal ? a) 1 b) 0.08642 c) 0
What does the ios::ate argument do?