Originally posted by Mr.JT
array of counters?? im sorry i dont quite understand.

What is mean is to create a new object each time but call it something different in each iteration of the loop. If the loop just contained: Object test(x,y,z); (where Object is the class being instantiated) then each interation would destroy the current instance of 'test'. Therefore to create multiple 'test' objects i need to call them something different each time the loop goes round. Adding a loop iteration indicator (like count) is just one possible way of doing it. This sort of thing is possible in MATLAB which is very similar to C so I was wondering how to do it in C/C++. I think in matlab the operator '+' is used? Maybe I could use a massive switch statement as the number of iterations in the loop is a known finite number, but this seems a rather inefficient way of doing it?
You CAN'T do what you're asking in c++.

As I said, you need an array of counters. Instead of accessing different counters by name (which you can't do) you access them by their position in the array. I don't really know how to put it more clearly than that.