#include using namespace std; int& MyInt() { int x = 7; //Try it with x declared static, //Although this appears to fix the problem do not rely on it. return x; } void main() { int &y = MyInt(); cout << y << endl; y++; cout << y << endl; }