MODULE 02 · BEGINNER

Pointers, References, and Raw Memory ArithmeticC++ Systems Programming · Module 2

Master low-level address calculation, pointer scaling, lvalue vs rvalue references, array-to-pointer decay, and strict const correctness.

4 lessons16 min readingCompilation Model, Memory Layout & RAII Foundations
Free, self-paced, and open to everyone. No account needed.
WHAT THIS MODULE COVERS

Pointers, References, and Raw Memory Arithmetic

Master low-level address calculation, pointer scaling, lvalue vs rvalue references, array-to-pointer decay, and strict const correctness.

BEFORE YOU START

Understanding of the C++ compilation model and process memory

WHAT YOU’LL BE ABLE TO DO

Mastery of 64-bit raw pointer addresses, address arithmetic scaling, lvalue/rvalue references, and array decay.

THE LESSON SEQUENCE

Read in order, or jump to what you need.

Every lesson builds on the one before it. Open any lesson to read the explanation, run the examples, and try the practice challenges.

  1. 02.01
    Raw Pointers, Dereferencing, and Typed Address Arithmetic

    Deconstruct pointer mechanics: 64-bit addresses, dereferencing indirection (*), address-of (&), pointer scaling rules, and void* type erasure.

    4 min
  2. 02.02
    Value Categories, Lvalue References, and Rvalue References

    Deconstruct C++ value categories (lvalue, prvalue, xvalue), reference binding rules, lifetime extension of temporaries, and rvalue references (&&).

    4 min
  3. 02.03
    Stack Arrays, Array Decay, and Dynamic Heap Allocation

    Master C-style raw arrays, the array-to-pointer decay phenomenon, dynamic memory allocation with new/delete and new[]/delete[], and modern std::array alternatives.

    4 min
  4. 02.04
    Const Correctness, Pointer Semantics, and Constexpr Mechanics

    Master const qualifiers: pointer-to-const vs const-pointer, const member functions, mutable escape hatches, and compile-time constexpr evaluation.

    4 min
MODULE SELF-CHECK

Ready to move on?

Calculate byte offsets for pointer arithmetic and explain reference collapsing rules.

Open the module self-check