C++: pointers and references?
Example:
int x = 10;
int* ptr = &x;
Pointers and references are used to refer to memory locations.
Solution:
int& ref = x;
*ptr = 20; // change value of x to 20 using pointer
ref = 30; // change value of x to 30 using reference