How can I change the variable to which a C++ reference refers? -
if have this:
int = 2; int b = 4; int &ref = a; how can make ref refer b after code?
this not possible, , that's by design. references cannot rebound.
if have this:
int = 2; int b = 4; int &ref = a; how can make ref refer b after code?
this not possible, , that's by design. references cannot rebound.
Comments
Post a Comment