Copy constructor, C/C++ Programming

What is copy constructor? describe the concept of copy constructor.

Posted Date: 2/12/2013 6:31:02 AM | Location : United States





Answer of the following question

Constructor which initializes the it''s object member variables ( by shallow copying) with another object of similar class. If you don''t implement one in your class then compiler implements one for you. for example:

(a) Boo Obj1(10); // calling Boo constructor

(b) Boo Obj2(Obj1); // calling boo copy constructor

(c) Boo Obj2 = Obj1;// calling boo copy constructor

Hope this explanation will help you.

Posted by Amy | Posted Date: 2/12/2013 6:35:40 AM


Related Discussions:- Copy constructor, Assignment Help, Ask Question on Copy constructor, Get Answer, Expert's Help, Copy constructor Discussions

Write discussion on Copy constructor
Your posts are moderated
Related Questions
Q: But MFC appear to encourage the employ of catch-by-pointer; should I do the similar? A: Depends. If you're utilizing MFC and catching one of their exceptions, by all means, d

WAP TO PRINT NUMBERS FROM 1-50 WHICH ARE DIVIDED BY 7 void main () { int a; clrscr (); a=1; while (a { if (a%7==0) printf ("%d\n",a); a++; } ge

#include #include #include #include #include //*Variables Used in Programs*// int k; int l; int d; int won; int loss; int cash = 500;

Write a program that does the following: Calculates the Velocity and Momentum of an object. The formula for the velocity is V=d/t and the formula Momentum is m=mass*velocity. Your

WAP TO SWAP THE THREE DIGIT NUMBER void main () { int b,r,n,r1,r2; clrscr (); printf ("Enter the Value: "); scanf ("%d",&n); r=n%10; n=n/10; r1=n%10;

Need help finishing my homework. It''s been 5 years since I''ve use C++. I am a VN.Net programmer. -Todd

what are the significances of scope resolution operator? Illustrate with example

answer for tcs is working question


(a) Define a procedure (deep-member x e) that takes a list x and an element e and returns #t if the element e is in the list or in any lists that the list x contains. e.g., (dee