int x = 10;
int * const p = &x;
const int **p1 = &p;
Having some trouble understanding why this is illegal.
EDIT
Thank you for all the great answers. Here is my interpretation of the answers, feel free to disagree. So, the error is in the 3rd line. It implies that original integer is constant but does not imply that the pointer it points to is constant and therefore it is illegal because we could attempt to change the pointer 'p' through 'p1' which is not possible because that is a constant pointer. So to fix this the third line must be:
int * const *p1 = &p;
This works because it says that while the original integer is non-constant (mutable) the pointer it points to is constant and therefore it is a legal statement. So this is also legal:
const int * const *p1 = &p;
This says the same thing except it also says that you cant change the original integer because it is constant.