Valid indexes for an array of size n are 0 to n-1. So when secondary is 3, it is not a valid index. The condition in the for loop will always evaluate to false (= is assignment) which is fortunate, since otherwise you would have an infinite loop of undefined behavior, instead of your not-a-loop with undefined behavior.