Check out example codes for "create copy constructor c++". It will help you in understanding the concepts better.

Code Example 1

// Copy constructor 
    Point(const Point &p2) {x = p2.x; y = p2.y; } 
  
    int getX()            {  return x; } 
    int getY()            {  return y; } 
};

Learn ReactJs, React Native from akashmittal.com