1. 15

Following this tweet about the lack of logical “xor” operators in many programming languages - one of the replies pointed to this c faq.

  1.  

  2. 6

    C has a logical XOR-operator, namely !=, provided you use only 1 and 0 as inputs.

      if (func1(...) != func2(...)) {
            /* func1 or func2 succeeded or failed, but not both :P */
      }
    

    If not, you just add a !! in front of each.

      if (!!(func1(...)) != !!(func2(...))) {
            /* func1 or func2 succeeded or failed, but not both :P */
      }