loop through a stack of structs

Hi all,
I have a list of structs stored in a stack.
for example:

struct mystruct{
int a;
int b;
}

instances of this struct are stored in a stack say mystack.
I now want to loop through this list of structs in mystack and update mystruct.a to mystrct.a + 1.How can i achieve this.


Show your stack. If it is a std::stack, then you will not "loop through". Not without popping.
Topic archived. No new replies allowed.