The ideal is to reduce the scope of the variables to the maximum, so that their life is as short as possible. This, although it does not seem like it, improves the security of the code.
It is very important not to reuse a variable for different uses as it helps create confusion.
These two points have the conclusion that we must avoid static variables except very justified cases.
The variable we use to loop through a loop should normally be declared in the loop itself. Thus at the end of the loop the variable will disappear:
for(int i=0; i<10; ++i)
std::cout << i;
std::cout <<i; // Error. i no existe en este punto.
If a function has two or more loops, it is normal to repeat the previous operation for each loop.