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
#questThere is a pebble merchant. He sells the pebbles, that are used for shining the floor. His main duty is to take the length of the room’s sides. But he sometimes mistakes doin

Help me evaluate suitable OpenCV filters to get an inital working tracking algorithm. In this case it's objects moving on water (sea) and since I have very limited OpenCV knowledge

I am having trouble declaring a variable and returning a value from my function.

Question 1 Explain the following Object Oriented Concepts with suitable examples for each Question 2 Explain the following Object Oriented Methodologies Question 3 Descr


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

c program to find pebble merchant

Aim: To implement a program to maintain information of employees in an educational institute using inheritance. Code:                       class staff {

flowchart of c programing to check the given number is prime or not

example of program to add two number