By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,967 Members | 2,124 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,967 IT Pros & Developers. It's quick & easy.

what does the ^ symbol mean in c language

P: 1
^ meaning in c language
^ symbol meaning of c language
Nov 19 '15 #1
Share this Question
Share on Google+
1 Reply


P: 80
It's NOT an exponent, like it is in other languages...

In C, the ^ is "Exclusive OR" (XOR). That means 'either one or the other, but not both'.

In binary,

1 ^ 1 = 0
1 ^ 0 = 1
0 ^ 1 = 1
0 ^ 0 = 0

Bitwise:

00 ^ 00 = 00
00 ^ 01 = 01
00 ^ 11 = 11
01 ^ 01 = 00
01 ^ 00 = 01
11 ^ 00 = 11
11 ^ 01 = 10
etc ...
Nov 19 '15 #2

Post your reply

Sign in to post your reply or Sign up for a free account.