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.


Comments

Popular posts from this blog

Python __call__ special method practical example -

arrays - jQuery - Retrieve values from HTML elements and return their sum -