Step Into Labs

Step Into C · Lesson 14 · Modeling Data

Bits & Bytes

Binary and hex, bitwise operators, masks, flags, shifts and alignment.

Part of Step Into C. The full lesson, its missions and the real compiler and debugger are in the course. Try a free lesson first to see how it works.

Every integer is a row of bits. Hex is the programmer's shorthand for it, because one hex digit is exactly 4 bits and two hex digits are one byte:

In this lesson

Missions

  1. Flags
  2. Take it apart
  3. Count the ones
  4. Align up