0186-dec_ary.c (264B)
1 struct node { 2 int index; 3 }; 4 5 struct node nodes[2]; 6 7 int 8 main(void) 9 { 10 int d = 1, c; 11 12 d = 1; 13 c = nodes[--d].index++; 14 if (d != 0 || nodes[0].index != 1) 15 return 1; 16 17 d = -1; 18 c = nodes[++d].index--; 19 if (d != 0 || nodes[0].index != 0) 20 return 2; 21 22 return 0; 23 }