char * const a;
means that the pointer is constant and immutable but the pointed data is not.
You could use const_cast
(in C++) or c-style cast to cast away the constness in this case as data itself is not constant.
const char * a;
means that the pointed data is constant and immutable but the pointer is not.
Using a const_cast
(C++) or c-style cast to cast away the constness in this case causes Undefined Behavior.