When copy constructor can be used?

Answer Posted / sachin magdum

1. "assigning" - don't use this word, it should be
initializing an object using another object of same type
2. When the object is passed to function - "by value"
3. when a function returns the object type - "by value"
here doesn't matter if you are assigning that returned
value to to another object or not.

Is This Answer Correct ?    9 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the difference between c++ and java.

604


What are maps in c++?

480


What is cout flush?

543


What is a far pointer? where we use it?

588


Explain "const" reference arguments in function?

588






Explain what are the sizes and ranges of the basic c++ data types?

615


If dog is a friend of boy and boy is a friend of house, is dog a friend of house?

530


what does the following statement mean? int (*a)[4]

592


What is private public protected in c++?

529


Can we sort map in c++?

577


What is runtime polymorphism in c++?

563


Is it possible to have a recursive inline function in c++?

521


How long will it take to learn programming?

564


Explain this pointer?

556


Which operator cannot be overloaded c++?

568