I have seen a particular style of code that according to me is dangerous and should be avoided, but I have seen it so many times in lot of places, that I am confused whether or not I am missing something.
int a[100];
/* Some code later */
for(i =0; (i < 100 && a[i] != 0); i++)
:
:
In the above code it is possible that the expression (i < 100 && a[i] != 0) is evaluated from right to left, in that case when i == 100, we are going out of bounds of the array 'a'.
Can someone explain whether or not this is safe code