|
From: <ri...@un...> - 2003-09-05 16:25:04
|
In your second example you are trying to create a reference
of type 'char*&' from '&c' that in fact it is not a variable
of the type 'char*&', if not the memory adresse of a variable
of type char. Then you are allowed to allocate this memory
adresse only in a constant reference, that is, in a variable of type
'char *const &'.
May be you can understand this subtle point verifying that this
piece of code compile without any problem although, aparently,
it is similar to your second 'problematic' example:
int main()
{
char c;
char *c1;
c1 = &c;
char * &r = c1;
}
The reason is unveiled, I think, with this example,
if not we can discuss about it.
saludos,
Ricardo.
|