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

What is cin clear () in c++?

1322


What is the last index number in an array of 100 characters a) 100 b) 99 c) 101

1230


Can you be able to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?

1163


What doescout<<(0==0) print out a) 0 b) 1 c) Compiler error: Lvalue required

1023


What is the use of cmath in c++?

1124


How do you initialize a string in c++?

1055


What is the use of bit fields in structure declaration?

1031


What is microsoft c++ redistributable?

1152


What is the purpose of ios::basefield in the following statement?

1306


What is object in c++ wikipedia?

1070


Describe exception handling concept with an example?

1101


What is difference between class and structure in c++?

1254


What is the best c++ ide?

1240


Explain what is polymorphism in c++?

1182


What is protected inheritance?

1098