What is copy constructor? - C++

What is copy constructor?

- Copy constructor allows creating new objects from existing objects by initialization.
- Example : First argument of is a reference to an object of the same type as is being constructed (const or non-const), which might be followed by parameters of any type (all having default values).
X(X& copyFromMe);

What is copy constructor?

A copy constructor is a special type of constructor that is used to create an object as a copy of an existing object. It takes an argument which is a reference to the object to be copied.
Define private, protected and public access control - C++
Define private, protected and public access control - Private is the default access specifier for every declared data item in a class.....
What is Turbo C++?
Turbo C++ - Turbo C++ provides an environment called IDE (Integrated Development...
How to control the number of chars read in a string by using scanf()? - C++
How to control the number of chars read in a string by using scanf()? - Doing this limits the length of the characters that will be read by scanf() to 20 characters.....
Post your comment
Discussion Board
c++
when we pass constructor as a object argument that constructor is known as copy constructor.
HRISHIKESH DHOLA 09-18-2013