Exclusive or bitwise operator

Member
Posts: 185
Joined: 2005.02
Post: #1
How the heck do you get this thing?
I have this code
Code:
int mask = 0x00000080;
    *settings = settings ˆ mask;
And it keeps giving me the error message "Syntax error at 'OTHER' token"
Why is it doing this? It wasn't just that Xcode was set to compiler default instead of C99 mode. For a while I thought it was the circumflex (ˆ), but thats not working for me and neither does ^ (shift 6).
Help!! (Yet again)
Quote this message in a reply
Member
Posts: 72
Joined: 2004.06
Post: #2
Dunno why the operator isn't working, but for starters I think you mean:

*settings = *settings ˆ mask;
not
*settings = settings ˆ mask;

"So long and thanks for all the fish" - In memory of Douglas Adams.
My Site
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #3
should be caret (shift-6) not any wacky alternative, too.
Quote this message in a reply
Member
Posts: 185
Joined: 2005.02
Post: #4
Corun Wrote:I think you mean:

*settings = *settings ˆ mask;
not
*settings = settings ˆ mask;

oh, right you are! hmm.... that fixed it! and yes it is ^ (shift 6)
Thanks!
Quote this message in a reply
Moderator
Posts: 508
Joined: 2002.09
Post: #5
OneSadCookie Wrote:should be caret (shift-6) not any wacky alternative, too.

On azerty keyboards that result in just 6. The ^ character is next to the p Wink

"When you dream, there are no rules..."
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #6
Silly Belgians Blink
Quote this message in a reply
Oldtimer
Posts: 834
Joined: 2002.09
Post: #7
I'm sure you all mean that it is next to Ã….
Quote this message in a reply
DoG
Moderator
Posts: 869
Joined: 2003.01
Post: #8
I am sure you all mean it's on a separate key at the top left. ^_^
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Conditional Operator Nick 8 4,216 Dec 14, 2005 01:49 PM
Last Post: zKing