/* postincrement.cpp -- Here is a trivial program using post-increment.
	We start with x equal 3. We do post-increment, add 2, assign
	(horror) to x. Then we printout x.
	In g++ I get 4, on Visual C++ I get 5.
	The time when the postincrement is done is not totally
	well specified in C++. That leads to a problem when the left
	hand side of the assignment is the same as the variable being 
	postincremented.
 */

#include <iostream>

int main()
{
	int x = 3;
	x = 2 + x++;
	cout << x << endl;
	return 0;
}