What is copy constructor?, C/C++ Programming

What is copy constructor?

 

 

Posted Date: 3/15/2013 4:01:37 AM | Location : United States





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

1.      Boo Obj1(10); // calling Boo constructor

2.      Boo Obj2(Obj1); // calling boo copy constructor

3.      Boo Obj2 = Obj1;// calling boo copy constructor

Posted by | Posted Date: 3/15/2013 4:01:51 AM


Related Discussions:- What is copy constructor?, Assignment Help, Ask Question on What is copy constructor?, Get Answer, Expert's Help, What is copy constructor? Discussions

Write discussion on What is copy constructor?
Your posts are moderated
Related Questions
It is a class defined in the scope of a function _ any function, whether a member functions or a free function. For instance: // Example : Local class // int f() { c

Literals (Constants) Constants are data storage locations whose address is not accessible for the user. Their value is not altered during the course of the program. Literal

compose a C program to solve the equation z2=(p1/Pg)+(v1^2/2g)+z1 p1=100kpa,v1=2m/s z1=3m P=1000kg/m^3 define g=9.81

Explain Operators in C Language? The C language is very rich in built - in - operators and it places more significance on operators than do most other computer languages. The C

padovan string for a natural number is defined

traffic light t junction I have 21 LEDs will 6 in each side 3 for the cars the other 3 will be for the people across the street this will be for each side and the last 3 for show


The car’s measurements are illustrated, using two arrays. Array 1 = {L, R, L, R, R, L, R, R, L, R, R, L, R, L, L, R, Z}

Pawnbroker software to be written in VB Project Description: I want software written for my pawnshop. I am currently using a program called pawnboss but would like to have my