Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
trying to understand bitwise operations
#3
Ok, so how are multiple values for a variable represented in binary? For example: flags = 1|2
And how would I test for each value, because this doesn't work: if(flags=1).
This is actually the core of my question.
I am trying to write a function that allows multiple flags, but I don't know how to test for specific values.
So, I looked at your code and that's when I found all the bitwise operations like: if(flags&2=0).


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)