You should also be aware that the behaviour of postincrement/decrement operators is different in C/C++ and Java.
Given
int a=1;
int a=1; in C/C++ the expression
a++ + a++ + a++
a++ + a++ + a++ evaluates to 3, while in Java it evaluates to 6. Guess why...
This example is even more confusing:
cout << a++ + a++ + a++ << "<->" << a++ + a++ ; prints 9<->2 !! This is because the above expression is equivalent to:
operator<<( operator<<( operator<<( cout, a++ + a++ ), "<->" ), a++ + a++ + a++ )