Chapter 15. BIT FIDDLING

I l @ ve RuBoard

Chapter 15. BIT FIDDLING

You will learn about the following in this chapter:

  • Operators

     ~   &   ^ >>    &=   =   ^=   >>=   = 

In this chapter, you review binary, octal, and hexadecimal number notations. Then you learn about two C facilities for handling the individual bits in a value: bitwise operators and bit fields.

With C, you can manipulate the individual bits in a variable. Perhaps you are wondering why anyone would want to. Be assured that sometimes this ability is necessary, or at least useful. For example, a hardware device is often controlled by sending it a byte in which each bit has a particular meaning. Also, operating system information about files is often stored by using particular bits to indicate particular items.

We'll investigate C's bit powers in this chapter after we supply you with some background about bits, bytes, binary notation, and other number bases.

I l @ ve RuBoard


C++ Primer Plus
C Primer Plus (5th Edition)
ISBN: 0672326965
EAN: 2147483647
Year: 2000
Pages: 314
Authors: Stephen Prata

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net