Does the number of iterations of the 'for' loop change if the second argument changes in one of the iterations?

Viewed 95

i've this code here:

for(i = openGates[0]; i < closeGates[0]; i++) {
    if(str[i] == '(') {
        closeGates.removeFirst();
        openGates.removeAt(1);        
    }
}

If brace found, closeGates[0]'s value will change. Will it change the number of iterations?

2 Answers

Apparently, no one decided to answer and I want to close this question so: yes, in C++ 'for' loop evaluates its conditions before every iteration thus the number of the iterations might change.

Related