Skip to main content
GameDev.net gamedev.net
🔒 Locked

XOR

Started by masonium Oct 11, 2001 at 6:18 PM 6 replies 350+ views
Maximus
Maximus
^
-----------------------"When I have a problem on an Nvidia, I assume that it is my fault. With anyone else's drivers, I assume it is their fault" - John Carmack
terminate
terminate
the XOR symbol is ^


--------------------------

Whats a pretty girl like you doing in a dirty mind like mine?

Edited by - terminate on October 11, 2001 7:23:31 PM
Those who dance are considered insane by those who cannot hear the music.
TerranFury
TerranFury
Bitwise xor can be used as a logical xor if you use parenthases like this:

if( (a==2)^(b==2) )
{
.......something goes here

This compiles and works fine using VC++6.

Here''s the source for the quick test program I made:

  

#include <iostream.h>

int main()
{
int a, b;

cin >> a >> b;

if((a==2)^(b==2))
cout << "XOR true\n";
else
cout << "XOR false\n";

return 0;
}

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.