Okay, I see where I wasn't thinking correctly. i would be set to -1 inside the loop, but it would be incremented back to zero before the next loop iteration. But, this would become an infinite loop because : i=0, check arrary element at zero. That element is not valid. set i=-1. increment loop so i=0 again. repeat forever.