cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Some bitwise stuff
Some bitwise stuff
Oct 14, 2009 at 7:13am UTC
AlwaysLearning
(116)
Is there a way to always flip a bit to false?
For example, if I had A = 4, B = 8, to always flip the 4th bit to true, is this:
A |= B;
Whereas I'm currently using to flip to false.
if( A & B )
A ^= B;
Oct 14, 2009 at 8:30am UTC
Abramus
(285)
A &= ~B;
Topic archived. No new replies allowed.