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't create variables at runtime. Use std:vector instead so you'll get var[0], var[1], etc.
std:vector
var[0]
var[1]