First, take a typedef from the equation for a moment.
const char *p and char const *p declare p as a non-constant pointer to const data; you can assign p to point out different things, but you cannot change the item that it points to.
char * const p declares p as a constant pointer to non-constant data; you cannot change p to point to another object, but you can change the object pointed to by p .
const char * const p and char const * const p declare p as a constant pointer to const data. This should be reasonably clear.
typedef bit unintuitive. ptr is synonymous with char * , so const ptr acts like char * const ; the const qualifier is applied to the pointer type, not to the char type.
source share