This is a tough thing to remember, because it has never been used. To sum up, I will not check it on C ++ primer later.
Const pointers are classified into three types:
1. pointer to the const object (1) definition form: const double * PT; // const is at the beginning of the definition. (2) Key: Pt can change the point but cannot change the value of the object to which it points. That is, its own value can be changed, but PT cannot be used to change the value of the object to which it points. Obviously, PT is a pointer to a const object. How can a const object be changed? However, Pt can also point to a non-const object, but treat it as a const object.
2. Const pointer (1) definition form: Double * const pt; // const in the middle of definition (2) Key: Pt cannot be changed, the value of the object it points to can be changed depending on the object itself. That is, the PT value cannot be changed. When Pt points to a const object, PT cannot be used to change the value of this object. When Pt points to a non-const object, you can use pt to change the value of this object.
3. Const pointer to the const object (1) definition form: const double * const pt; // There are two const, one at the beginning of the definition and the other in the middle of the definition. (2) Key: Pt neither changes the point nor the value of the object it points. That is, the value of PT itself cannot be changed, and the value of the object to which it points cannot be modified.