Before You Start
Consider the following code snippet:
int x = 5;
int y = x;
y = 10;
cout << x << " " << y;
Key point: assignment is copying data from one place to another place.
The line
int y = x;
initializes a separate variable that just happens to have the same value asx
. Nothing you do tox
after this point will affecty
and vice-versa.
(When logged in, completion status appears here.)