Is there any way to find the address of a reference?

References don’t have their own addresses. Although references may be implemented as pointers, there is no need or guarantee of this.

The C++ FAQ says it best:

Unlike a pointer, once a reference is
bound to an object, it can not be
“reseated” to another object. The
reference itself isn’t an object (it
has no identity; taking the address of
a reference gives you the address of
the referent; remember: the reference
is its referent).

Please also see my answer here for a comprehensive list of how references differ from pointers.

The reference is its referent

Leave a Comment