XOR in c

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dulanjalie
    New Member
    • Feb 2008
    • 3

    #1

    XOR in c

    how to do the XOR operation in c

    dulie
  • Laharl
    Recognized Expert Contributor
    • Sep 2007
    • 849

    #2
    Bitwise or logical? The bitwise version is builtin, use ^. If you want a logical xor, you'll have to write it yourself. Where are you having trouble with it?

    Comment

    • dulanjalie
      New Member
      • Feb 2008
      • 3

      #3
      Originally posted by Laharl
      Bitwise or logical? The bitwise version is builtin, use ^. If you want a logical xor, you'll have to write it yourself. Where are you having trouble with it?

      I want to get the ones compliment of a word. So XOR is the operation that i should use right?

      Comment

      • Banfa
        Recognized Expert Expert
        • Feb 2006
        • 9067

        #4
        Originally posted by dulanjalie
        I want to get the ones compliment of a word. So XOR is the operation that i should use right?
        No wrong, you want the Bitwise One's Complement operator look it up in your text book or google it.

        Comment

        Working...