Read the declaration from right to left and the two fall out cleanly. 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 means you may not write through that pointer. The object itself may still change through some other non-const handle. A const pointer means the address is fixed for the pointer's 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 ↓