Generic names such as i j k are indeed commonly used, but it is actually a common bad practice. Variable name should properly reflect the purpose of the stored value. For example if it is used to index vector of items then it should be named item_index instead of just i. This may seem unnecessary verbose but such approach helps avoiding common bugs when variables with generic names are messed up, for example compare this frobs[i] = some_frob; bars[j] = some_bar; with frobs[bar_index] = some_frob; bars[frob_index] = some_bar;. Actually in such case not only indexing variable name should be non-generic, but variable type should not be not generic as well so conversion of one indexing type to another would require explicit cast. I think the situation with presence of several generically named variables is similar to Three Star Programmer in the sense that it should never happen in properly written code.
Variables declared inside of loop scope are not visible outside of loop scope, so there is no problem. However construct for(int i=1;i<10;i++) is actually a syntax pitfall, as it ignores normal scoping rules and makes variable i declared outside of loop scope visible inside of scope. This is actually different from C, where declaring variable inside of for construct was prohibited. Basically
for(int i = 1; i < 10; ++i) { // loop body } // i is not visible here i = 42; // error
in C++ is a more compact equivalent to
{ int i; for(i = 1; i < 10; ++i) { /* loop body */ } } /* i is not visible here */ i = 42; /* error */
in C.
Some compilers however may demonstrate non-standard behavior and allow variable declared inside of for construct be visible even after for loop has exited. For example Visual C++ with /Zc:forScope-
for(int i = 1; i < 10; ++i) { // loop body } // i is still visible here i = 42; // no error
iis scoped to theforloop - it doesn't exist anymore after the loop is finishedi,j,kare conventionally understood to be indexes in loop, but if it makes it more clear, do use other names