3.9 Example 8

“C” provides a conditional expression. Thus if “a” and “b” are integer variables,

    (a > b ? a : b)

is an expression whose value is that of the larger of “a” and “b”.

However this does not work if “a” and “b” are to be regarded as unsigned integers. Hence there is a use for the procedure

  6326 max (a, b)
       char *a, *b;
       {
         if (a > b)
           return(a);
         return(b);
       }

The trick here is that “a” and “b”, having been declared as pointers to characters are treated for comparison purposes as unsigned integers.

The body of the procedure could have been written as

    max (a, b)
    char *a, *b;
    {
      if (a > b)
        return(a);
      else
        return(b);
    }

but the nature of “return” is such that the “else” is not needed here!