O'Reilly logo

C Programming Essentials by S. K. Bandyopadhyay, K. N. Dey

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix B. More on Bitwise Operators in C

What, Why, and When?

Bitwise operators are good for saving space and execution time in many cases. Sometimes it is necessary to manipulate bits instead of words. Even though such features are available in C, they are not often taught in an introductory-level programming course.

If one intends to do some work in systems programming, or other forms of low-level programming (e.g., operating systems, device drivers, socket programming, network programming), it is required to know how to access and manipulate bits.

Bit shifting to multiply by two is a fairly common operation; so, it does not affect readability in the way that advanced use of bit manipulation can in some cases — for instance, using XOR to switch ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required