I just asked myself what is the proper syntax of References to Pointers and/or Pointers to References. Also is there any difference between them?
int*& x1;
int&* x2;
EDIT:
int*& valid;
int&* wrong;
One makes sense, the other doesn't. You can only form pointer types based on object and function types, or on void. Since a reference is none of those, there is no type "pointer to reference".
Here's another perspective: A pointer stores the address of an object or function. A reference variable isn't an object, though, it merely refers to an object. You don't take the address of a variable, but the address of an object.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With