1. Beware of Unsigned Integers

    July 28, 2013

    Here's a little quiz: What value does m have after running the following code:

    unsigned int one = 1;
    long minusOne = -1;
    long m = MAX(one, minusOne);
    

    If your answer was "it depends" – congratulations, you can probably stop reading now.

    Here's the thing: If you run this on a ...