A pointer to const cannot be used to change the object it points at. A const pointer cannot be made to point anywhere else. To tell them apart, read the declaration from right to left. const binds to whatever sits on its left, unless nothing is there, in which case it binds right.
int x = 1, y = 2;
const int* p = &x; // *p is read-only; p = &y is fine
int* const q = &x; // *q = 5 is fine; q = &y will not compile
A pointer to const only stops writes through that pointer. The object itself may still change through some other non-const handle. A const pointer has a fixed address for its whole life, so it must be initialized at declaration.
Pointer to const is the one you write constantly. It is how a function says it will read your data and not modify it. That lets callers pass constants safely, and lets the compiler catch an accidental write.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
The diagram below the answer is the concept . Jump to it ↓