Exercise
- Pointers and references.
int x = 5;
int y = 10;
int* px = &x;
int* py = &y;
px = py;
// What are the values of x, y, *px and *py now?
int i = 5;
int j = 10;
int& ri = i;
int& rj = j;
ri = rj;
// What are the values of i, j, ri and rj now?
// Hint: a reference cannot be re-assigned. What's the last line doing?