Yea, but you'll need to store it's original value in another variable. Or if it's known at compile time just manually reset it back to that in the code.
EDIT:
This is assuming the variable has scope outside of the loop. If not, that variable is gone forever once the loop exits.
I fail to understand what you mean. Your loop is a different scope. variables created in the loop, remain in the loop, ones that were created outside of it, used in the loop will keep the values they gained in the loop. unless you write some code to change them manually. So you could reset an int doing this; int x = 0;
Edit:
looking at ResidentBiscuit's answer, I think I misunderstood the OP's question.
Thank you guys. Essentially I have a variable that needs to reset when it is finished in the loop. It sounds like I'll need to create another variable to reset the original variable.
Not exactly. Neither easting not origEasting is ever assigned any value before the loop. And neither is altered within the loop.
Line 8 simply assigns the random contents of origEasting to easting.
this might make more sense...
1 2 3 4 5 6 7 8 9 10
int count = 5;
int saveCount = count;
for (int j=0;j<=20;j++)
{
count = count + j;
cout << count << endl;
}
count = saveCount;