I\'m trying to create a loop that will will create a new variable but also change the name of the variable, such as increasing in value, automatically. Not sure if this is possi
You can't. It's not possible in C++.
To declare and initialize a variable in each iteration is however possible:
for (int i = 0; i != 10; ++i) {
int var = i; // Declare 'var' and assign value of 'i' to it.
} // 'var' object goes out of scope and is destroyed
Names are visible from the point where they are declared until the end of the scope in which the declaration appears. Names have scope
and Objects have lifetimes
.