Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

when can we use copy constructor?

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


Please Help Members By Posting Answers For Below Questions

In what situations do you have to use initialization list rather than assignment in constructors?

1104


Which format specifier is used for printing a pointer value?

1099


I want explanation for this assignment: how to connect mysql database using c/c++,please explain this detailly?

2113


What is the type of this pointer in c++?

1110


What are exceptions c++?

1109


How do you print a string on the printer?

1081


What is the best book for c++ beginners?

1095


How to get the current position of the file pointer?

1098


What is the type of 'this' pointer?

1058


Mention the ways in which parameterized can be invoked. Give an example of each.

1111


What is the difference between global variables and local variable

1112


What are static member functions?

1153


What is dev c++ used for?

1072


Explain all the C++ concepts using examples.

1250


Why do we use templates?

1109