Qualifying a type with const
may have some surprises. Consider the following
toto A = { 0 }; toto const* p = &A;
where toto
is an opaque typedef
that we don’t control. The question would be if the initialization of p
is valid or not? From the way I pose that question, you have probably guessed the answer: it depends.
Continue reading “const
and arrays”