C Books Guide and List
C++ Books Guide and List
Best Java Books

3.8k questions

4k answers


10.7k users

0 votes
asked anonymous

1 Answer

0 votes
No. You can't separate the reference from the referent.

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).

In that sense, a reference is similar to a const pointer such as int* const p (as opposed to a pointer to const such as const int* p). In spite of the gross similarity, please don't confuse references with pointers; they're not at all the same.
answered Advisor 5.6k points 1 7 14

Related questions

0 votes
1 answer 213 views
0 votes
1 answer 56 views
can anybody tell me What happens if you assign to a reference? thanks..
asked anonymous
0 votes
1 answer 41 views
1 vote
1 answer 43 views