| <<< The need for a copy constructor | Index | Calling copy constructors >>> |
How are copy constructors defined ?
// point.h
class Point
{
public:
// copy constructor
Point( Point& other );
private:
int m_x;
int m_y;
};
// point.cpp
Point::Point( Point& other )
{
m_x = other.m_x;
m_y = other.m_y;
}
| <<< The need for a copy constructor | Index | Calling copy constructors >>> |