The output of these loops is not what I expected.
A have an array of 4 ‘group’ structs that I iterate through with a for each loop. I print out the name of the group before I enter a While loop which iterates 4 times and prints “hello”.
I expected the output to be:
Group A
Hello
Hello
Hello
Hello
Group B
Hello
Hello
Hello
Hello
Group C
...
However the output is actually
Group A
Hello
Hello
Hello
Hello
Group B
Group C
Group D
What’s happening?