Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
| vs || operator on C99 bool types
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Nick Keighley, post: 4225120"] I think the obvious reason is that they have different semantics. Using & may preclude the easy replacement of a variable with a function. if (bufferFull & LatchDown) flushAll(); if (bufferFull() & LatchDown()) flushAll(); now we have to careful that the functions don't have side effects. And that the Latchdown() function works even when the buffer is not full. And that unnecessary calls to latchDown() aren't too expensive. The rule is (in this and many other contexts) use the clearest and most appropriate semantic form to achieve your ends. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
| vs || operator on C99 bool types
Top