Re:Do you know your bitwise operators?
by gamegoblin on Friday January 10, 2014 @02:42PM
(#7038851)
The only time I find myself using bit manipulations in production code is when I am writing a library that uses an int to represent a set of option flags (where each bit is a boolean flag). It's pretty common in C libs to define some constants like
And then pass in your options to a function like f(... FLAG_1+FLAG_2) so you can have an optional number of flags in a single argument.
[ Parent
| on HN ]
There are no comments on this comment yet.