Consider:
int* ptr = (int*)0xDEADBEEF;
cout << (void*)&*ptr;
How illegal is the *
, given that it's used in conjunction with an immediate &
and given that there are no overloaded op&
/op*
in play?
(This has particular ramifications for addressing a past-the-end array element &myArray[n]
, an expression which is explicitly equivalent to &*(myArray+n)
. This Q&A addresses the wider case but I don't feel that it ever really satisfied the above question.)