Why isn’t it legal to convert “pointer to pointer to non-const” to a “pointer to pointer to const”

From the standard:

const char c="c";
char* pc;
const char** pcc = &pc;   // not allowed
*pcc = &c;
*pc="C";                // would allow to modify a const object

Leave a Comment