Silly, but simple question

Discuss topics that apply across the products, such as the PocketC language, or development in general

Postby Dman on Thu Jul 05, 2001 2:00 am

What exactly does the XOR keyword do? I have not been able to find anything on it and have never used it in any other language I know.
----[self-mutilation or self-empowerment?]----
Posts: 128
Joined: Mon Jul 02, 2001 8:08 pm
Location: USA

Postby ianf on Mon Jul 09, 2001 2:03 pm

XOR is exclusive or. The regular or is more like an and/or. The easiest way to see the difference is to find examples of the truth tables for the various Boolean expressions.

In essence the result is true if one or the other value is 'whatever you are testing' but not both.


If that's all wrong it's a long time since I went to college :)
Posts: 92
Joined: Mon Dec 11, 2000 7:25 am
Location: United Kingdom

Postby guy on Tue Jul 10, 2001 7:28 am

The truth table for XOR is:

0 xor 0 = 0
1 xor 0 = 1
0 xor 1 = 1
1 xor 1 = 0

In C and PocketC XOR is a bitwise operation between two integers taken as bit patterns.

PocketC CE API interface:
PCForm and CE API forum:
Posts: 879
Joined: Thu Dec 07, 2000 8:58 am
Location: United Kingdom

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest