Thread: what is the ^= operator?

  1. #1
    Registered User
    Join Date
    Oct 2003
    Posts
    2

    what is the ^= operator?

    what does ^= do in C programming? like i saw in a code that calls a function that executes a round of a game, they put player ^= player up with the rest of the initialization and naming. can someone help? thanks.

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    It's the exclusive-OR assignment operator, the effect is the same as:
    Code:
    a = a ^ b;
    Conveniently enough, I just posted something about the bit operators here.
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Changing flags from a DLL?
    By RobotGymnast in forum C++ Programming
    Replies: 17
    Last Post: 10-27-2008, 01:34 PM
  2. Smart pointer class
    By Elysia in forum C++ Programming
    Replies: 63
    Last Post: 11-03-2007, 07:05 AM
  3. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  4. Operator Overloading (Bug, or error in code?)
    By QuietWhistler in forum C++ Programming
    Replies: 2
    Last Post: 01-25-2006, 08:38 AM
  5. operator overloading and dynamic memory program
    By jlmac2001 in forum C++ Programming
    Replies: 3
    Last Post: 04-06-2003, 11:51 PM