O
omni
Something like
int const * const * const * const ippp = &ipp;
compiles fine. Does that mean * can be replaced by * const
at any place, i.e. pointer can be replaced by const ptr?
So you can have expressions of any complexity with const ptrs?
Obviously you can only have one basetype being const.
There is no difference between const int x;
and int const x;
is there?
The examples in the Microsoft documentation all talk about const ptr
to const int, and nothing more involved than that, but my reading
shows any pointer within a declaration can be replaced by const ptr,
although for expressions beyond one level of indirection I could not
see what would be the point, you would rarely see that sort of
declaration.
int const * const * const * const ippp = &ipp;
compiles fine. Does that mean * can be replaced by * const
at any place, i.e. pointer can be replaced by const ptr?
So you can have expressions of any complexity with const ptrs?
Obviously you can only have one basetype being const.
There is no difference between const int x;
and int const x;
is there?
The examples in the Microsoft documentation all talk about const ptr
to const int, and nothing more involved than that, but my reading
shows any pointer within a declaration can be replaced by const ptr,
although for expressions beyond one level of indirection I could not
see what would be the point, you would rarely see that sort of
declaration.