Jump to content

Please, how come this code doesn't work ?


Recommended Posts

The |= operator assigns the logical OR operation between the left and right operands to the left variable. if lieCheck is 0 then 0 | 1 is 1 which is equivalent to a boolean True. Anything operated with 1 will return a truth value because the 1 will always ensure that the last bit is set to 1. Maybe you wanted to use the & operator instead.

  • Like 1
Link to post
Share on other sites
The |= operator assigns the logical OR operation between the left and right operands to the left variable. if lieCheck is 0 then 0 | 1 is 1 which is equivalent to a boolean True. Anything operated with 1 will return a truth value because the 1 will always ensure that the last bit is set to 1. Maybe you wanted to use the & operator instead.
Thanks..vm
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...