// Compilable parts of previous program. #include #include #include "point.h" int main(){ Point p(1,2); // p is a Point. It can be moved (by mutation). p.move(0,1); const Point q(3,4); // q is a constant point. const Point *r = &p; // r is pointer to a constant point Point const *rr = &p; // rr is pointer to a constant point - fully equivalent to definition or r above. Point *const s = &p; // s is a constant pointer to 'the point p'. *const is a 'declarator operator'. s->move(1,2); // OK. Point const* w = &p; // w is a pointer to a constant point. const* is NOT a 'declarator operator'. // Point const ... and const Point means the same. const Point *const t= &p; // t is a constant pointer to a constant point. Point const *const v= &p; // Same as definition of t (Point and const has just been reversed). }