"Marcin Kalicinski" <ka****@poczta.onet.pl> wrote in message
news:Tr******************@newsfe4-win.ntli.net
void f(const char *&text);
Is this a const reference to char * or a reference to const char *?
And how to write both of them?
You read from right to left, so it is a reference to a pointer to const
char. All references are const in the sense that you cannot "reseat" them to
refer to a different object. Your only choices in the present context are
between
1. a reference to a pointer to const char, as above,
const char *&text
2. a reference to a const pointer to char, which is
char *const &text
3. a reference to a const pointer to const char, which is
const char *const &text
Note that const char in 1. and 3. is the same as char const
--
John Carson