Assigning pointers to pointers with or without qualifiers
While this compiles:
char* p2c;
const char* p2cc = p2c; //fine
because lhs pointed type has all the qualifiers of rhs pointed type, this
does not:
char** p2p2c;
const char** p2p2cc = p2p2c; //fail
but this does:
const char * const * p2cp2cc = p2p2c; //fine
Why exactly does this happen?
No comments:
Post a Comment