easy, use another variable which can store the value of your desired variable.
use label on your specific point and use goto statemnt to get there
int x;
for (;;)
for(;;)
for(;;)
{
int y=123;
if(y==123){ x=y; goto mylabel;}
}
mylabel:
cout << x;
goto is not a good approach but has its advantages, when you dont want to use return statement and do want make a jump, just that goto can jump anywhere in a function which makes it dangerous....
ps: if you dont want to leave your sequence but just want to see your variable than remove goto statement from if clause. if it is not just a value you want, you can also use a pointer type to access your variable.