What I would like to do is have a loop that names a certain number of variables each time. So sometimes when I run the program, this loop will create say 3 variables a1, a2 & a3 but other times it could name more, e.g. (if this sort of thing were possible):
for(int i=1; i<=n;i++) {
int ai = i;
}
So in the case (for i=1)
the name of the int would be a1 and contains the int 1. This clearly won't work, but I was wondering if there was a way to achieve this effect -- or should I stop hacking and use a different data structure?
Thanks.
Also, this is just an example. I'm using it to create arrays.