There was a C programming question that I had trouble with involving pre- and postincrement of variables. I had never encountered this type of situation, where the target of an assignment statement is also an operand:
int v, x, y;
v = x = 5;
y = 11;
v = v++;
x = ++y + x++;
printf("%d %d %d\n", y, x, v);
The value of v is 5. The values of y and x are 12 and 18, respectively. I don't understand why either v is not equal to 6 or x is not equal to 17. I checked K&R, which doesn't say anything explicit about what happens when the target of an assignment statement is also pre- or postincremented. My general opinion is that one wouldn't want to write such code, which could have unexpected side effects, but perhaps I'm wrong.
Update: Didn't get the job. Oh well.