Autochanging Variable In A Do-While

Hi everone!
I am totally new to C++. Please see if you can provide a sample code as to how to declaring auto changing variable to be declared in a do while loop when u don't know the number of variables u would be requiring, For instance a variable like:
int Var1
int Var2
...
and so on until the loop ends?
So you want to declare new variables in a do-while loop per iteration of the loop?

You could try an stl vector and use push_back. It's advanced material, but I'm sure you can get your head around it.
http://cplusplus.com/reference/stl/vector/
http://cplusplus.com/reference/stl/vector/push_back/
vector<int> naem;

-Albatross
Last edited on
Topic archived. No new replies allowed.