I need a way to concurrently create variables with a loop.
Like... Instead of
int my_var_1 = 1;
int my_var_2 = 1;
int my_var_3 = 1;
Because the user may need thousands of variables, and I don't want there to be a limit. So I was wondering if there was a way to declare variables with a loop appending a number to the end of the name.
Something like the following:
for(int i=1; i<3; i++) {
int my_var_ + i = 1;
}
This in theory would create three integers named my_var_1, my_var_2, and my_var_3, and set the value of them all to 1.
Can I do something like this?