I have a for-loop which runs over i. For every iteration, I wish that it creates a variable with the name var_i i.e if my loop runs over i=0<
i
var_i
i=0<
You can also use an array of the required size and initialize it with a default value in the loop
int var[4]; for(int i=0; i < 4; i++){ var[i] = 0; }