#include <stdio.h>
int main(void) {
static int a[10];
int x=0;
a[x]=++x;
printf("%d %d %d",a[0],a[1],a[2]);
return 0;
}
my doubt here is [ ] has high precedence over ++ which in turn has precedence over =, so i think it a[x] = ++x; is evaluated in 3 phase like,
phase1: a[x] -> (a+x)* -> (a+0)* -> a*
phase2: ++x -> x=1
phase3: a*=1 or a[0]=1
so finally answer should be 1 0 0, but it is giving 0 1 0 as output.