The type of a string literal is really const char*, but you converted
it to char*.
The type of string literal is 'const char[N]', not 'const char*'.
This conversion is permitted for C compatibility. However,
trying to change an element of the literal is prohibited.
Yes.
Though the syntax is
char* p = "Plato";
internally it is
const char* p = "Plato";
OK.
No. Internally it still is 'char* p'. In general case
const-qualification of an access path is not related to
const-qualification of the object this path leads to.
Since it is only internally const char* it gives a runtime error?
It gives a runtime error because you are trying to modify an
non-modifiable object - string literal. It has nothing to do with the
pointer 'p' itself.
Yes there is no contradiction.
char* p = "Plato";
I forgot to see p as const char*.
'p' is not a 'const char*'. What would really make sense is declare it
as 'const char* p' explicitly instead of tryig to "remember to see" it
as such. Don't use the deprecated 'string literal -> char*' conversion
unless you have a very good reason to do so.