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
Math,
4 months ago
Computer Science,
8 months ago
Math,
10 months ago
Chemistry,
10 months ago
English,
10 months ago