Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Welcome 🤗! In the next ~4h we will cover:

Footpath signs, Clem Rutter, CC BY-SA 3.0, Source

Footpath signs, Clem Rutter, CC BY-SA 3.0, Source

Motivation

Every value in computer memory lives at an address, like a house on the street. Often you don’t want the value itself. You want to know where it is, so you can find it later, share it with another part of the program, or change it in place.

pointer

a variable whose value is a location in the computer’s memory. Pointer (computer programming)

Learning goals

Preparation Review

Code without main

In the following you will see code snippets like this:

(int) 42

(int) 42 means that the variable i is of the type int and has the value 42. These code cells are simplified programs without main and printf for teaching purposes [1]

E: Teach your peers

Question pool

Coding

Hello pointer

Pointærray

Arrays as arguments

E: Reflection

Let us revisit our learning goals:

Footnotes
  1. These interactions are based on the clang-repl program, which is like a shell for the C++ language or REPL.

    clang-repl program does not seem to be part of the compiler package we installed on Windows. It may be available in the LLVM.LLVM package, which I did not test.

    To generate the results on this website I use a plugin that runs clang-repl in the background: Jupyter notebook running a Clang-Repl-based kernel. I use them there to explain how code works.

  2. The book has 200 pages, each page about 200 words, and each word has about 5 letters. If we also account for the spaces between letters, the content would correspond to about 200⋅200⋅(5+1)B=240 KB200 \cdot 200 \cdot (5 + 1)\mathrm{B} = 240\,\mathrm{KB}.