3 ms·
The loop searches for a true comparison until it reaches one, them stop. And, i=4 is not ignored by the compiler, it is declared as undefined behaviour. What t
by aylons 12y ago
The loop searches for a true comparison until it reaches one, them stop.
And, i=4 is not ignored by the compiler, it is declared as undefined behaviour. What the compiler MAY do is to always return true.
In this cause, it will always return true, either because it reached the 5th value ([4]), or because there was a match in the first 4 values.
As the result will always be true, the compiler may then simply return true and skip the loop.