C basics

The C that embedded interviews assume. Sizes and layouts are shown for 32-bit ARM and 64-bit ARM side by side.

  1. 01

    Types, sizes and byte order

    How many bytes each type uses on 32-bit and 64-bit ARM, how a number is laid out in those bytes, and how to pick a type with an exact size.

    Start
  2. 02

    Signed, unsigned, overflow, promotion

    Wraparound, undefined signed overflow, and how small integer types are promoted to int.

    Start
  3. 03

    Casts, operators and precedence

    How C parses expressions such as a & b == c and *p++, what a cast changes, and which expressions are undefined.

    Start
  4. 04

    Keywords

    What static, extern, const, volatile, register and inline guarantee, and what they do not.

    Planned
  5. 05

    Storage classes and segments

    Which objects land in .data, .bss, .rodata, the stack and the heap.

    Planned
  6. 06

    Functions and stack frames

    Pass by value, pointers into the caller, dangling returns and the ARM calling convention.

    Planned
  7. 07

    struct, union, enum, typedef

    Padding from member alignment, union overlays and byte order.

    Planned
  8. 08

    Preprocessor

    Text substitution, arguments evaluated twice, do { } while (0), # and ##.

    Planned