How can I change the variable to which a C++ reference refers?

This is not possible, and that’s by design. References cannot be rebound.

Leave a Comment