We have following class. I need explanation of some parts of code.
class CPoint3D
{
public:
double x, y, z;
CPoint3D (double dX = 0.0, double dY = 0.0, double dZ = 0.0)
: x(dX), y(dY), z(dZ) {}
//what means these lines of code?
CPoint3D operator + (const CPoint3D& point) const;
CPoint3D operator - (const CPoint3D& point) const;
CPoint3D operator * (double dFactor) const;
CPoint3D operator / (double dFactor) const;
};
I guess using
CPoint3D operator + (const CPoint3D& point) const;
function I can easily add/subtract/multiply/divide instances of CPoint3D
class?
Can someone explain this with examples ? Thanks!