I always thought casting to be an easy exercise - hard to debug, but easy to perform. Sure, you must know some symbols like u and leading zeroes and there are also specialities like that a character is casted to an unsigned integer and so on. But then Mr. Sommerlad came up with the following confusing example:
cout << -3u + 2.0 << endl;
What will the output be? The question is, to what the u sign is bound. What binds stronger? The minus or the u sign. The answer is -3u remains unsigned and therefore is mapped to 232-3 in a 32 bit system. The output on the console will be 4.2950e+09.
That is because the minus sign is not a cast.