O'Reilly logo

Programming in C, Third Edition by Stephen G. Kochan

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

Chapter 12. Operations on Bits

AS MENTIONED ON PREVIOUS OCCASIONS, the C language was developed with systems programming applications in mind. Pointers are the perfect case in point because they give the programmer an enormous amount of control over and access into the computer’s memory. Along these same lines, systems programmers frequently must get in and “twiddle with the bits” of particular computer words. C provides a host of operators specifically designed for performing operations on individual bits.

Recall from the discussions in the previous chapter the concept of a byte. On most computer systems, a byte consists of eight smaller units called bits. A bit can assume either of two values: 1 or 0. So a byte stored at address 1000 in a computer’s ...

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