I know from this answer that a pointer const int** z
is supposed to be read as
Variable z is [a pointer to [a pointer to a
const int
object]].
In my humble opinion, this would mean if z=&y
then y
should be a pointer to a const int
object. However, the following code also compiles:
int x=0;
int const* y=&x;
const int** z=&y;
Why is an int const*
object i.e. a const
pointer to an int
instead of a pointer to a const int
acceptable to be the pointed object of z
?