Computer Science, asked by pratibhachaudhary278, 6 months ago

what is copy constructor and write syntax of it's declaration​

Answers

Answered by sakshi893891
1

Copy Constructor is a type of constructor which is used to create a copy of an already existing object of a class type. It is usually of the form X (X&), where X is the class name. The compiler provides a default Copy Constructor to all the classes

I HOPE MY ANAWER WILL HELP YOU

PLEAE PLEASE MARK ME AS BRAINLIEST

Answered by DevPalliwar
0

Answer:

Copy constructor is a type of constructor which is used to create a copy of an already existing object of a class type. It is usually of the form X (X&), where X is the class name. The compiler provides a default Copy Constructor to all the classes.

A copy constructor is a member function which initializes an object using another object of the same class. A copy constructor has the following general function prototype: ClassName (const ClassName &old_obj); Following is a simple example of copy constructor.

Similar questions