C array assignment and indexing with similar variable.
- by Todd R.
Hello! I apologize if this has been posted before. Compiling under two separate compilers, BCC 5.5 and LCC, yields 0 and 1.
#include <stdio.h>
int main(void)
{
int i = 0, array[2] = {0, 0};
array[i] = ++i;
printf("%d\n", array[1]);
}
Am I to assume not all compilers evaluate expressions within an array from right to left?