create copy constructor c++

C++
// Copy constructor 
    Point(const Point &p2) {x = p2.x; y = p2.y; } 
  
    int getX()            {  return x; } 
    int getY()            {  return y; } 
}; https://www.geeksforgeeks.org/copy-constructor-in-cpp/
Source

Also in C++: