For variable (or function argument) declarations, it helps if you read them right to left, i. e. starting at the name of the variable:
char* const p
means
p
is
const
and points ('
*
') to an object of type
char
. With respect to your function code, the relevant information is that p is const (i. e. cannot be changed) and the char it points to is not (i. e. it can be changed).
Similarly;
const char* p
means that
p
points ('
*
') to an object of type
char
that is
const
. The relevant information is that you can change
p
as it is not
const
, but you cannot change the character it points to.
Also check out
this nice site for automatically translating C/C++ type declarations into readable english. ;-)