int i, x, a[2]; void q(int b) { // here you have: a = [1, 2], and b = 1 from the call a[0] = 2; // now: a = [2, 2] i = 1; x = b+a[i]; // x = 1 + a[1] = 1 + 2 = 3 b = a[0]; // b = 2 but forgot because it's local to the function } void main() { i = 0; a[0] = 1; a[1] = 2; // a[i] = a[0] = 1, so: q(1) q(a[i]); }