#include <iostream>
#include <cstdlib>
using namespace std;

int main()
{
	int i {10};
	int j {20};

	int *p {&i};
		
	//Allowed to use p to do all of these things to i.
	++*p;      //Increment i. 
	--*p;      //Decrement i.
	*p = 11;   //Change i to 11.
	cout << "Please input an integer and press RETURN. ";
	cin >> *p; //Overwrite i.
	cout << "The value of i is " << *p << ".\n";
	p = &j;    //We can even make p point at a different variable.


	const int *q {&i};

	//Can't use q to do any of these things to i.
	//++*q;   //Try to use q to change the value of i.  Not allowed.  Etc.
	//--*q;
	//*q = 21;
	//cout << "Please input an integer and press RETURN. ";
	//cin >> *q; 
	cout << "The value of i is " << *q << ".\n";
	q = &j;   //We can still make q point at a different variable.
	
	return EXIT_SUCCESS;
}