All variables have a certain scope. If a variable is created within a certain block of code, its scope ends when that block ends. For instance


for ( int i = 0; i < 10; i++ ){
int j = i;//...