int i=0; cout << i << " " << i++ << " " << i << "\n";
The answer is:
> 1 0 0
The reason is that operator<<() operates from right to
left even though the output will be produced from left to
right. The following code will produce the expected result:
int i=0; cout << i << " "; cout << i++ << " "; cout << i << "\n";
The output being:
> 0 0 1