Explain the copy constructor with the help of example.
Answers
Answered by
0
Answer:
A copy constructor is a member function which initializes an object using another object of the same class.
example:using namespace std ;
class point
{
private :
int x, y:
public :
Point ( int x1 , int y1 ) {x =x1 = y1;}
Similar questions
English,
5 months ago
Math,
5 months ago
History,
5 months ago
Computer Science,
11 months ago
Chemistry,
1 year ago