Bit-Fields in C++ - Practical Electron Microscopy and Database - - An Online Book - |
||||||||
Microanalysis | EM Book http://www.globalsino.com/EM/ | ||||||||
================================================================================= | ||||||||
Unlike many other computer languages, C++ has a built-in method to access a
single bit within a byte. Bit access is achieved by using a bit-field. Bit-fields
can be useful for a number of reasons, for instance: All of these functions above can be performed using the bitwise operators; however, a bit-field can add more transparency and readability to the program. The method, which C++ uses to access bits, is based on the structure. A bit-field, in fact, is just a special type of structure member that defines its length in bits.
|
||||||||
================================================================================= | ||||||||
|
||||||||